summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2006-01-24 20:57:56 +0000
committerMarcus Boerger <helly@php.net>2006-01-24 20:57:56 +0000
commita372669d4a2cfb45cfd40f42210eee5c0ee971fb (patch)
tree5a29e88ff91aff44d320528bb753d7a8d9569b21
parent0e42375ded43a86794f060d17bcbd722326c9bfe (diff)
downloadphp-git-a372669d4a2cfb45cfd40f42210eee5c0ee971fb.tar.gz
- Fixed Bug #35978 %n format string specifier wrongly implemented
-rw-r--r--main/snprintf.c3
-rw-r--r--main/spprintf.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/main/snprintf.c b/main/snprintf.c
index a7e50701ed..caaf3b78c0 100644
--- a/main/snprintf.c
+++ b/main/snprintf.c
@@ -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;
diff --git a/main/spprintf.c b/main/spprintf.c
index d090d7dee4..bb357caca3 100644
--- a/main/spprintf.c
+++ b/main/spprintf.c
@@ -722,7 +722,7 @@ fmt_string:
case 'n':
*(va_arg(ap, int *)) = xbuf->len;
- break;
+ goto skip_output;
/*
* Always extract the argument as a "char *" pointer. We
@@ -802,6 +802,7 @@ fmt_error:
PAD(unicode, xbuf, min_width - s_len, pad_char);
}
}
+skip_output:
fmt++;
}
return;