diff options
author | gstein <gstein@13f79535-47bb-0310-9956-ffa450edef68> | 2000-11-02 00:14:34 +0000 |
---|---|---|
committer | gstein <gstein@13f79535-47bb-0310-9956-ffa450edef68> | 2000-11-02 00:14:34 +0000 |
commit | c1fbdd0a7b1168130d0098eae4404fa230fca142 (patch) | |
tree | 61e6644b90d669322bf805fde0b045cf5e7d7bc4 /strings | |
parent | ba289569af19fac5b66a08b632ca0522474cad71 (diff) | |
download | libapr-c1fbdd0a7b1168130d0098eae4404fa230fca142.tar.gz |
don't print anything for "%n"
Submitted by: Karl Fogel <kfogel@collab.net<
Message-ID: <200010302044.e9UKiuj09461@galois.collab.net>
Reviewed by: Greg Stein
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60619 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'strings')
-rw-r--r-- | strings/apr_snprintf.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 8b577dad3..f525a79a0 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -708,6 +708,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), /* * Default variable settings */ + boolean_e print_something = YES; adjust = RIGHT; alternate_form = print_sign = print_blank = NO; pad_char = ' '; @@ -1000,6 +1001,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), *(va_arg(ap, short *)) = cc; else *(va_arg(ap, int *)) = cc; + print_something = NO; break; /* @@ -1131,10 +1133,12 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), /* * Print the string s. */ - for (i = s_len; i != 0; i--) { - INS_CHAR(*s, sp, bep, cc); - s++; - } + if (print_something == YES) { + for (i = s_len; i != 0; i--) { + INS_CHAR(*s, sp, bep, cc); + s++; + } + } if (adjust_width && adjust == LEFT && min_width > s_len) PAD(min_width, s_len, pad_char); |