]> granicus.if.org Git - php/commitdiff
- MFH Bug #35978 %n format string specifier wrongly implemented
authorMarcus Boerger <helly@php.net>
Tue, 24 Jan 2006 20:59:46 +0000 (20:59 +0000)
committerMarcus Boerger <helly@php.net>
Tue, 24 Jan 2006 20:59:46 +0000 (20:59 +0000)
main/snprintf.c
main/spprintf.c

index a7e50701eda7cb8aab68fe697dd85240d38a70cb..caaf3b78c0458302beeb44539618dd7545ef9ef1 100644 (file)
@@ -1015,7 +1015,7 @@ static int format_converter(register buffy * odp, const char *fmt,
 
                                case 'n':
                                        *(va_arg(ap, int *)) = cc;
-                                       break;
+                                       goto skip_output;
 
                                        /*
                                         * Always extract the argument as a "char *" pointer. We 
@@ -1096,6 +1096,7 @@ fmt_error:
                        if (adjust_width && adjust == LEFT && min_width > s_len)
                                PAD(min_width, s_len, pad_char);
                }
+skip_output:
                fmt++;
        }
        odp->nextb = sp;
index 93be4d1ae4c78b4a1c6a04ed78c8501122c7a9a9..67375aee96bb24a669c1110f3a2d7518a71f5198 100644 (file)
@@ -631,7 +631,7 @@ static void xbuf_format_converter(smart_str *xbuf, const char *fmt, va_list ap)
 
                                case 'n':
                                        *(va_arg(ap, int *)) = xbuf->len;
-                                       break;
+                                       goto skip_output;
 
                                        /*
                                         * Always extract the argument as a "char *" pointer. We 
@@ -709,6 +709,7 @@ fmt_error:
                        if (adjust_width && adjust == LEFT && min_width > s_len)
                                PAD(xbuf, min_width - s_len, pad_char);
                }
+skip_output:
                fmt++;
        }
        return;