Fix a bug where numbers could be truncated to four decimal digits in certain circumstances.

This affected values from $RANDOM, and could potentially also result in corruption of pid values if they were large enough.
This commit is contained in:
Stephen Heumann 2015-01-15 21:28:35 -06:00
parent bb88e739e5
commit d305e3b821
1 changed files with 1 additions and 1 deletions

View File

@ -224,7 +224,7 @@ char* FAST_FUNC itoa_to_buf(int n, char *buf, unsigned buflen)
// It so happens that sizeof(int) * 3 is enough for 32+ bit ints.
// (sizeof(int) * 3 + 2 is correct for any width, even 8-bit)
static char local_buf[sizeof(int) * 3];
static char local_buf[sizeof(int) * 3 + 2];
/* Convert unsigned integer to ascii using a static buffer (returned). */
char* FAST_FUNC utoa(unsigned n)