1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

estream: Fix minor glitch in "%.*s" format.

* common/estream-printf.c (pr_string): Take care of non-nul terminated
strings.
This commit is contained in:
Werner Koch 2014-06-25 20:25:28 +02:00
parent 3a01b22071
commit aa5b4392aa

View File

@ -1209,7 +1209,9 @@ pr_string (estream_printf_out_t outfnc, void *outfncarg,
string = "(null)";
if (arg->precision >= 0)
{
for (n=0,s=string; *s && n < arg->precision; s++)
/* Test for nul after N so that we can pass a non-nul terminated
string. */
for (n=0,s=string; n < arg->precision && *s; s++)
n++;
}
else