diff options
Diffstat (limited to 'src/doprnt.c')
-rw-r--r-- | src/doprnt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/doprnt.c b/src/doprnt.c index 731afe400cc..02584554577 100644 --- a/src/doprnt.c +++ b/src/doprnt.c @@ -68,10 +68,10 @@ doprnt (buffer, bufsize, format, format_end, nargs, args) int size_bound; fmt++; - /* Copy this one %-spec into fmtcopy. */ + /* Copy this one %-spec into fmtcpy. */ string = fmtcpy; *string++ = '%'; - while (1) + while (string < fmtcpy + sizeof fmtcpy - 1) { *string++ = *fmt; if (! (*fmt >= '0' && *fmt <= '9') && *fmt != '-' && *fmt != ' ') |