/* Output like sprintf to a buffer of specified size.
Also takes args differently: pass one pointer to the end
of the format string in addition to the format string itself.
- Copyright (C) 1985, 2001-2011 Free Software Foundation, Inc.
+ Copyright (C) 1985, 2001-2012 Free Software Foundation, Inc.
This file is part of GNU Emacs.
of the (`int') argument, suitable for display in an Emacs buffer.
. For %s and %c, when field width is specified (e.g., %25s), it accounts for
- the diplay width of each character, according to char-width-table. That
+ the display width of each character, according to char-width-table. That
is, it does not assume that each character takes one column on display.
. If the size of the buffer is not enough to produce the formatted string in
case 'e':
case 'g':
{
- double d = va_arg(ap, double);
+ double d = va_arg (ap, double);
sprintf (sprintf_buffer, fmtcpy, d);
/* Now copy into final output, truncating as necessary. */
string = sprintf_buffer;
case 'c':
{
- int chr = va_arg(ap, int);
+ int chr = va_arg (ap, int);
tem = CHAR_STRING (chr, (unsigned char *) charbuf);
string = charbuf;
string[tem] = 0;
return nbytes;
}
+#if defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
+
/* Format to buffer *BUF of positive size *BUFSIZE, reallocating *BUF
and updating *BUFSIZE if the buffer is too small, and otherwise
behaving line esprintf. When reallocating, free *BUF unless it is
return nbytes;
}
+#endif
+
/* Act like exprintf, except take a va_list. */
ptrdiff_t
evxprintf (char **buf, ptrdiff_t *bufsize,