Message ID | 20110228203412.GM30899@tyan-ft48-01.lab.bos.redhat.com |
---|---|
State | New |
Headers | show |
--- libquadmath/printf/quadmath-printf.c.jj 2011-02-16 11:13:15.000000000 +0100 +++ libquadmath/printf/quadmath-printf.c 2011-02-28 18:30:07.590808338 +0100 @@ -256,7 +256,7 @@ quadmath_snprintf (char *str, size_t siz qfp.fp = NULL; qfp.str = str; - qfp.size = size; + qfp.size = size ? size - 1 : 0; qfp.len = 0; qfp.file_p = 0; @@ -265,7 +265,7 @@ quadmath_snprintf (char *str, size_t siz else __quadmath_printf_fp (&qfp, &info, (const void *const *)&fpnum_addr2); - if (qfp.size) + if (size) *qfp.str = '\0'; return qfp.len;