Commit 26898943 authored by Andreas Schwab's avatar Andreas Schwab

(doprnt): Fix overflow check.

parent 528c56e2
2009-10-21 Andreas Schwab <schwab@linux-m68k.org>
* doprnt.c (doprnt): Fix overflow check.
2009-10-21 Jan Djärv <jan.h.d@swipnet.se>
* xterm.c (x_term_init): Remove XSynchronize call done for debugging.
......
......@@ -126,9 +126,9 @@ doprnt (buffer, bufsize, format, format_end, nargs, args)
unsigned n = *fmt - '0';
while ('0' <= fmt[1] && fmt[1] <= '9')
{
if (n * 10 / 10 != n
|| (n = n * 10 + (fmt[1] - '0')) < n)
if (n * 10 + fmt[1] - '0' < n)
error ("Format width or precision too large");
n = n * 10 + fmt[1] - '0';
*string++ = *++fmt;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment