]> granicus.if.org Git - php/commitdiff
Correct fix this time... (?)
authorJouni Ahto <jah@php.net>
Wed, 31 May 2000 22:44:29 +0000 (22:44 +0000)
committerJouni Ahto <jah@php.net>
Wed, 31 May 2000 22:44:29 +0000 (22:44 +0000)
ext/standard/formatted_print.c

index 93f7acae6da1c6e1d48246d3ed2eab617adaffa5..affc1d999924a943236b8050c8325a6bc7f21716 100644 (file)
@@ -159,10 +159,6 @@ 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) {
@@ -176,7 +172,7 @@ php_sprintf_appendstring(char **buffer, int *pos, int *size, char *add,
                *buffer = erealloc(*buffer, *size);
        }
        if (alignment == ALIGN_RIGHT) {
-               if (sign && padding=='0') { (*buffer)[(*pos)++] = '-'; add++; }
+               if (sign && padding=='0') { (*buffer)[(*pos)++] = '-'; add++; len--; }
                while (npad-- > 0) {
                        (*buffer)[(*pos)++] = padding;
                }