Skip to content
Snippets Groups Projects
Commit 9926de2c authored by Jakub Jelinek's avatar Jakub Jelinek Committed by Jakub Jelinek
Browse files

quadmath-printf.c (quadmath_snprintf): Make sure that for size > 0 str is always zero terminated.

	* printf/quadmath-printf.c (quadmath_snprintf): Make sure
	that for size > 0 str is always zero terminated.

From-SVN: r170572
parent 94369251
No related branches found
No related tags found
No related merge requests found
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
......
......@@ -256,7 +256,7 @@ quadmath_snprintf (char *str, size_t size, const char *format, ...)
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 size, const char *format, ...)
else
__quadmath_printf_fp (&qfp, &info, (const void *const *)&fpnum_addr2);
if (qfp.size)
if (size)
*qfp.str = '\0';
return qfp.len;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment