Mercurial > sdl-ios-xcode
diff src/stdlib/SDL_string.c @ 1659:14717b52abc0 SDL-1.3
Merge trunk-1.3-3
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 17 May 2006 08:18:28 +0000 |
parents | 845b1619c8f6 |
children | 782fd950bd46 887c3600826b |
line wrap: on
line diff
--- a/src/stdlib/SDL_string.c Mon May 01 06:58:33 2006 +0000 +++ b/src/stdlib/SDL_string.c Wed May 17 08:18:28 2006 +0000 @@ -985,10 +985,10 @@ SDL_ltoa(value, num, radix); size = SDL_strlen(num); - if ( size > maxlen ) { - size = maxlen; + if ( size >= maxlen ) { + size = maxlen-1; } - SDL_strlcpy(text, num, size); + SDL_strlcpy(text, num, size+1); return size; } @@ -999,10 +999,10 @@ SDL_ultoa(value, num, radix); size = SDL_strlen(num); - if ( size > maxlen ) { - size = maxlen; + if ( size >= maxlen ) { + size = maxlen-1; } - SDL_strlcpy(text, num, size); + SDL_strlcpy(text, num, size+1); return size; } @@ -1014,10 +1014,10 @@ SDL_lltoa(value, num, radix); size = SDL_strlen(num); - if ( size > maxlen ) { - size = maxlen; + if ( size >= maxlen ) { + size = maxlen-1; } - SDL_strlcpy(text, num, size); + SDL_strlcpy(text, num, size+1); return size; } @@ -1028,10 +1028,10 @@ SDL_ulltoa(value, num, radix); size = SDL_strlen(num); - if ( size > maxlen ) { - size = maxlen; + if ( size >= maxlen ) { + size = maxlen-1; } - SDL_strlcpy(text, num, size); + SDL_strlcpy(text, num, size+1); return size; } @@ -1101,6 +1101,9 @@ ++fmt; /* FIXME: implement more of the format specifiers */ + while ( *fmt == '.' || (*fmt >= '0' && *fmt <= '9') ) { + ++fmt; + } while (!done) { switch(*fmt) { case '%':