1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-23 15:07:03 +01:00

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

* common/estream-printf.c (pr_string): Take care of non-nul terminated
strings.
--
Resolved conflicts:
	common/estream-printf.c - white spaces
This commit is contained in:
Werner Koch 2014-06-25 20:25:28 +02:00
parent 505f0a642f
commit 998f085297

View File

@ -1143,7 +1143,9 @@ pr_string (estream_printf_out_t outfnc, void *outfncarg,
string = "(null)"; string = "(null)";
if (arg->precision >= 0) 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++; n++;
} }
else else