diff options
author | Jouni Ahto <jah@php.net> | 2000-05-31 22:27:09 +0000 |
---|---|---|
committer | Jouni Ahto <jah@php.net> | 2000-05-31 22:27:09 +0000 |
commit | 1e7c5b8562de9370b5c4174951ea7fbc93b2944d (patch) | |
tree | ad5f701cbc55920ccdb76898f80d4f63b99f4335 | |
parent | 1e56dd781a1a7b3511f06c8a019c28823d9585b9 (diff) | |
download | php-git-1e7c5b8562de9370b5c4174951ea7fbc93b2944d.tar.gz |
Fix a nasty off-by-one with negative numbers.
# Hey, this has been there for years undetected.
-rw-r--r-- | ext/standard/formatted_print.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index 9a4c67c5ca..93f7acae6d 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -159,6 +159,10 @@ php_sprintf_appendstring(char **buffer, int *pos, int *size, char *add, npad=0; } + if (sign) { + len--; + } + PRINTF_DEBUG(("sprintf: appendstring(%x, %d, %d, \"%s\", %d, '%c', %d)\n", *buffer, *pos, *size, add, min_width, padding, alignment)); if (max_width == 0) { |