*** empty log message ***
[bpt/emacs.git] / src / doprnt.c
index 9afdd5a..b0dcc2a 100644 (file)
@@ -29,6 +29,14 @@ Boston, MA 02111-1307, USA.  */
 #include <float.h>
 #endif
 
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
 #include "lisp.h"
 
 #ifndef DBL_MAX_10_EXP
@@ -40,8 +48,6 @@ Boston, MA 02111-1307, USA.  */
    another macro.  */
 #include "charset.h"
 
-extern long *xmalloc (), *xrealloc ();
-
 static int doprnt1 ();
 
 /* Generate output from a format-spec FORMAT,
@@ -293,7 +299,8 @@ doprnt1 (lispstrings, buffer, bufsize, format, format_end, nargs, args)
            case 'c':
              if (cnt == nargs)
                error ("not enough arguments for format string");
-             tem = CHAR_STRING ((int) (EMACS_INT) args[cnt], charbuf, string);
+             tem = CHAR_STRING ((int) (EMACS_INT) args[cnt], charbuf);
+             string = charbuf;
              cnt++;
              string[tem] = 0;
              width = strwidth (string, tem);