diff options
author | thevenyp <thevenyp@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-12-13 16:58:01 +0000 |
---|---|---|
committer | thevenyp <thevenyp@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-12-13 16:58:01 +0000 |
commit | 1492c0432f4b506b7f3e2cca4ee3bd3b6885079f (patch) | |
tree | 67255f6b79fe74f54f82abaec9fe145a3840930e /printf.c | |
parent | 5ebd37b79f81a6cce363934f4205f71f40a4eee4 (diff) | |
download | mpfr-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.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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); |