]> git.eshelyaron.com Git - emacs.git/commitdiff
(message3): Pass copy of lisp string to message_dolog.
authorKim F. Storm <storm@cua.dk>
Mon, 12 Sep 2005 13:42:30 +0000 (13:42 +0000)
committerKim F. Storm <storm@cua.dk>
Mon, 12 Sep 2005 13:42:30 +0000 (13:42 +0000)
src/xdisp.c

index a07e50aba89c6069c62d128d3f4837033e1a73a0..0b34856aa6a59159b2400cca885a167ef8395e8e 100644 (file)
@@ -7061,7 +7061,15 @@ message3 (m, nbytes, multibyte)
   /* First flush out any partial line written with print.  */
   message_log_maybe_newline ();
   if (STRINGP (m))
-    message_dolog (SDATA (m), nbytes, 1, multibyte);
+    {
+      char *buffer;
+      USE_SAFE_ALLOCA;
+
+      SAFE_ALLOCA (buffer, char *, nbytes);
+      bcopy (SDATA (m), buffer, nbytes);
+      message_dolog (buffer, nbytes, 1, multibyte);
+      SAFE_FREE ();
+    }
   message3_nolog (m, nbytes, multibyte);
 
   UNGCPRO;