]> code.delx.au - gnu-emacs/blobdiff - src/doprnt.c
* w32inevt.c (w32_console_read_socket) [SYNC_INPUT]:
[gnu-emacs] / src / doprnt.c
index 05b194c9dbb12f2bb6989de8ed24f68af3874009..95c2d46ac54bb4aec020ebd8502124c4cb1bd8c3 100644 (file)
@@ -2,7 +2,7 @@
    Also takes args differently: pass one pointer to an array of strings
    in addition to the format string which is separate.
    Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005,
-                 2006, 2007, 2008  Free Software Foundation, Inc.
+                 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -117,7 +117,7 @@ doprnt1 (lispstrings, buffer, bufsize, format, format_end, nargs, args)
   char fixed_buffer[20];       /* Default buffer for small formatting. */
   char *fmtcpy;
   int minlen;
-  unsigned char charbuf[5];    /* Used for %c.  */
+  unsigned char charbuf[MAX_MULTIBYTE_LENGTH + 1];     /* Used for %c.  */
 
   if (format_end == 0)
     format_end = format + strlen (format);
@@ -326,8 +326,7 @@ doprnt1 (lispstrings, buffer, bufsize, format, format_end, nargs, args)
     };
 
   /* If we had to malloc something, free it.  */
-  if (big_buffer)
-    xfree (big_buffer);
+  xfree (big_buffer);
 
   *bufptr = 0;         /* Make sure our string end with a '\0' */
   return bufptr - buffer;