summaryrefslogtreecommitdiff
path: root/printf.c
diff options
context:
space:
mode:
authorthevenyp <thevenyp@280ebfd0-de03-0410-8827-d642c229c3f4>2007-12-13 16:58:01 +0000
committerthevenyp <thevenyp@280ebfd0-de03-0410-8827-d642c229c3f4>2007-12-13 16:58:01 +0000
commit1492c0432f4b506b7f3e2cca4ee3bd3b6885079f (patch)
tree67255f6b79fe74f54f82abaec9fe145a3840930e /printf.c
parent5ebd37b79f81a6cce363934f4205f71f40a4eee4 (diff)
downloadmpfr-1492c0432f4b506b7f3e2cca4ee3bd3b6885079f.tar.gz
Add handle for null size case in mpfr_snprintf
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@5073 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'printf.c')
-rw-r--r--printf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/printf.c b/printf.c
index 370c8e9b0..4288f0241 100644
--- a/printf.c
+++ b/printf.c
@@ -145,6 +145,12 @@ mpfr_snprintf (char *buf, size_t size, const char *fmt, ...)
{
va_list ap;
int ret;
+
+ if (size == 0)
+ return 0;
+
+ MPFR_ASSERTD (buf != NULL);
+
va_start (ap, fmt);
ret = mpfr_vsnprintf (buf, size, fmt, ap);