summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorstriker <striker@13f79535-47bb-0310-9956-ffa450edef68>2002-07-13 21:34:36 +0000
committerstriker <striker@13f79535-47bb-0310-9956-ffa450edef68>2002-07-13 21:34:36 +0000
commitbcb8e21ac8f62eae25e4503108f0cc2072f84fa1 (patch)
tree85049fefb07f326c707cb7c2f5125639982d8ecb /strings
parent8b6e5eb50e100447ced8a55bf4e3a42c8e252d52 (diff)
downloadlibapr-bcb8e21ac8f62eae25e4503108f0cc2072f84fa1.tar.gz
Remove a bogus fixup from apr_vformatter, which made sure a NUL byte could
fit in by flushing if the final character was at the exact end of the buffer it was using. Take care of the case that the fixup was handling in apr_psprintf, by ensuring we can fit a NUL byte from the beginning. Implement this by calling flush if we start with a 0 byte buffer (in which nothing can fit anyway). Secondly make sure that the flush function never tries to use a block that has less than APR_PSPRINTF_MIN_STRINGSIZE bytes to spare. Thanks to Nuutti Kotivuori <naked@iki.fi> for pointing out the problem, digging around for answers and providing patches. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63654 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'strings')
-rw-r--r--strings/apr_snprintf.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c
index f73bb32c6..0d7d3e14d 100644
--- a/strings/apr_snprintf.c
+++ b/strings/apr_snprintf.c
@@ -1197,10 +1197,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *),
fmt++;
}
vbuff->curpos = sp;
- if (sp >= bep) {
- if (flush_func(vbuff))
- return -1;
- }
+
return cc;
}