From bcc8f8f11a88655b3f9f59789a9171823fceb7ec Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 8 Feb 2000 00:27:21 +0000 Subject: Ron Zapp corrected a sprintf() problem --- src/urlglob.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/urlglob.c b/src/urlglob.c index 846f86c2f..48974d1fa 100644 --- a/src/urlglob.c +++ b/src/urlglob.c @@ -277,7 +277,8 @@ char *next_url(URLGlob *glob) { *buf++ = pat->content.CharRange.ptr_c; break; case UPTNumRange: - buf += sprintf(buf, "%0*d", pat->content.NumRange.padlength, pat->content.NumRange.ptr_n); + sprintf(buf, "%0*d", pat->content.NumRange.padlength, pat->content.NumRange.ptr_n); + buf += strlen(buf); /* make no sprint() return code assumptions */ break; default: printf("internal error: invalid pattern type (%d)\n", pat->type); @@ -316,7 +317,8 @@ char *match_url(char *filename, URLGlob glob) { *buf++ = pat.content.CharRange.ptr_c; break; case UPTNumRange: - buf += sprintf(buf, "%0*d", pat.content.NumRange.padlength, pat.content.NumRange.ptr_n); + sprintf(buf, "%0*d", pat.content.NumRange.padlength, pat.content.NumRange.ptr_n); + buf += strlen(buf); break; default: printf("internal error: invalid pattern type (%d)\n", pat.type); -- cgit v1.2.3