summaryrefslogtreecommitdiff
path: root/src/doprnt.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-07-04 01:26:20 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2012-07-04 01:26:20 -0700
commitc7f2cd7fd629e6af07eaa2354eda1b7bc81b22aa (patch)
tree159baf0fa54265b49eacff122ee849286128cbe3 /src/doprnt.c
parent8ce70ed205e01913845330d084b9dd793b66d2c6 (diff)
downloademacs-c7f2cd7fd629e6af07eaa2354eda1b7bc81b22aa.tar.gz
* doprnt.c (doprnt): Don't assume string length fits in 'int'.
Tighten new eassert a bit.
Diffstat (limited to 'src/doprnt.c')
-rw-r--r--src/doprnt.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/doprnt.c b/src/doprnt.c
index 707dd0648b5..2aa236d8bbf 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -135,8 +135,8 @@ ptrdiff_t
doprnt (char *buffer, ptrdiff_t bufsize, const char *format,
const char *format_end, va_list ap)
{
- const char *fmt = format; /* Pointer into format string */
- register char *bufptr = buffer; /* Pointer into output buffer.. */
+ const char *fmt = format; /* Pointer into format string. */
+ char *bufptr = buffer; /* Pointer into output buffer. */
/* Use this for sprintf unless we need something really big. */
char tembuf[DBL_MAX_10_EXP + 100];
@@ -150,7 +150,7 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format,
/* Buffer we have got with malloc. */
char *big_buffer = NULL;
- register int tem = -1;
+ ptrdiff_t tem = -1;
char *string;
char fixed_buffer[20]; /* Default buffer for small formatting. */
char *fmtcpy;
@@ -368,7 +368,7 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format,
/* Copy string into final output, truncating if no room. */
doit:
- eassert (tem != -1);
+ eassert (0 <= tem);
/* Coming here means STRING contains ASCII only. */
if (STRING_BYTES_BOUND < tem)
error ("Format width or precision too large");