Commit dbadb64b authored by Kim F. Storm's avatar Kim F. Storm
Browse files

(add_to_log): Use SAFE_ALLOCA.

parent 799c08ac
......@@ -6315,6 +6315,7 @@ add_to_log (format, arg1, arg2)
char *buffer;
int len;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
/* Do nothing if called asynchronously. Inserting text into
a buffer may call after-change-functions and alike and
......@@ -6331,10 +6332,12 @@ add_to_log (format, arg1, arg2)
msg = Fformat (3, args);
len = SBYTES (msg) + 1;
buffer = (char *) alloca (len);
SAFE_ALLOCA (buffer, char *, len);
bcopy (SDATA (msg), buffer, len);
message_dolog (buffer, len - 1, 1, 0);
SAFE_FREE (len);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment