mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
* vasprintf.c: Hack to handle NULL for %s.
This commit is contained in:
parent
a71981bace
commit
bc8364ec4f
@ -1,3 +1,7 @@
|
|||||||
|
2002-08-20 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* vasprintf.c: Hack to handle NULL for %s.
|
||||||
|
|
||||||
2002-08-09 Werner Koch <wk@gnupg.org>
|
2002-08-09 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
* signal.c: New. Taken from GnuPG 1.1.91.
|
* signal.c: New. Taken from GnuPG 1.1.91.
|
||||||
|
@ -68,7 +68,8 @@ vasprintf (char **result, const char *format, va_list *args)
|
|||||||
}
|
}
|
||||||
while (strchr ("hlL", *p))
|
while (strchr ("hlL", *p))
|
||||||
++p;
|
++p;
|
||||||
/* Should be big enough for any format specifier except %s and floats. */
|
/* Should be big enough for any format specifier except %s
|
||||||
|
and floats. */
|
||||||
total_width += 30;
|
total_width += 30;
|
||||||
switch (*p)
|
switch (*p)
|
||||||
{
|
{
|
||||||
@ -92,7 +93,13 @@ vasprintf (char **result, const char *format, va_list *args)
|
|||||||
total_width += 307;
|
total_width += 307;
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
total_width += strlen (va_arg (ap, char *));
|
{
|
||||||
|
char *tmp = va_arg (ap, char *);
|
||||||
|
if (tmp)
|
||||||
|
total_width += strlen (tmp);
|
||||||
|
else /* in case the vsprintf does prints a text */
|
||||||
|
total_width += 25; /* e.g. "(null pointer reference)" */
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
case 'n':
|
case 'n':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user