X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/86633eab8a77697f6e15aae568868781a5a1023f..136220349968063bef3f249baddba30a24b52ec2:/src/doprnt.c diff --git a/src/doprnt.c b/src/doprnt.c index 638fa4d631..b8eb0f0719 100644 --- a/src/doprnt.c +++ b/src/doprnt.c @@ -1,7 +1,7 @@ /* 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. @@ -26,7 +26,7 @@ along with GNU Emacs. If not, see . */ 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 @@ -347,7 +347,7 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format, 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; @@ -427,7 +427,7 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format, 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; @@ -486,6 +486,8 @@ esprintf (char *buf, char const *format, ...) 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 @@ -505,6 +507,8 @@ exprintf (char **buf, ptrdiff_t *bufsize, return nbytes; } +#endif + /* Act like exprintf, except take a va_list. */ ptrdiff_t evxprintf (char **buf, ptrdiff_t *bufsize,