comparison src/xdisp.c @ 56196:abdb38fe88c5

(add_to_log): Use SAFE_ALLOCA.
author Kim F. Storm <storm@cua.dk>
date Mon, 21 Jun 2004 21:55:56 +0000
parents 6fbabfb26a3c
children 1dae117d6134 dbcd0af66869 59dcbfe97385
comparison
equal deleted inserted replaced
56195:3204d2175b6a 56196:abdb38fe88c5
6313 Lisp_Object args[3]; 6313 Lisp_Object args[3];
6314 Lisp_Object msg, fmt; 6314 Lisp_Object msg, fmt;
6315 char *buffer; 6315 char *buffer;
6316 int len; 6316 int len;
6317 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 6317 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
6318 USE_SAFE_ALLOCA;
6318 6319
6319 /* Do nothing if called asynchronously. Inserting text into 6320 /* Do nothing if called asynchronously. Inserting text into
6320 a buffer may call after-change-functions and alike and 6321 a buffer may call after-change-functions and alike and
6321 that would means running Lisp asynchronously. */ 6322 that would means running Lisp asynchronously. */
6322 if (handling_signal) 6323 if (handling_signal)
6329 args[1] = arg1; 6330 args[1] = arg1;
6330 args[2] = arg2; 6331 args[2] = arg2;
6331 msg = Fformat (3, args); 6332 msg = Fformat (3, args);
6332 6333
6333 len = SBYTES (msg) + 1; 6334 len = SBYTES (msg) + 1;
6334 buffer = (char *) alloca (len); 6335 SAFE_ALLOCA (buffer, char *, len);
6335 bcopy (SDATA (msg), buffer, len); 6336 bcopy (SDATA (msg), buffer, len);
6336 6337
6337 message_dolog (buffer, len - 1, 1, 0); 6338 message_dolog (buffer, len - 1, 1, 0);
6339 SAFE_FREE (len);
6340
6338 UNGCPRO; 6341 UNGCPRO;
6339 } 6342 }
6340 6343
6341 6344
6342 /* Output a newline in the *Messages* buffer if "needs" one. */ 6345 /* Output a newline in the *Messages* buffer if "needs" one. */