* printf/quadmath-printf.c (quadmath_snprintf): Make sure
that for size > 0 str is always zero terminated.
From-SVN: r170572
+2011-02-28 Jakub Jelinek <jakub@redhat.com>
+
+ * printf/quadmath-printf.c (quadmath_snprintf): Make sure
+ that for size > 0 str is always zero terminated.
+
2011-02-20 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/47827
qfp.fp = NULL;
qfp.str = str;
- qfp.size = size;
+ qfp.size = size ? size - 1 : 0;
qfp.len = 0;
qfp.file_p = 0;
else
__quadmath_printf_fp (&qfp, &info, (const void *const *)&fpnum_addr2);
- if (qfp.size)
+ if (size)
*qfp.str = '\0';
return qfp.len;