that for size > 0 str is always zero terminated.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170572
138bc75d-0d04-0410-961f-
82ee72b054a4
+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;