diff options
author | Werner Koch <[email protected]> | 2002-08-20 11:59:38 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2002-08-20 11:59:38 +0000 |
commit | 009390ddb1373c7a0aa8b170ccf325abfe45d6d9 (patch) | |
tree | 7b2ef2d0fe45e092c067635bb9ac1cc70c181ef3 | |
parent | Added some feature requests. (diff) | |
download | gpgme-009390ddb1373c7a0aa8b170ccf325abfe45d6d9.tar.gz gpgme-009390ddb1373c7a0aa8b170ccf325abfe45d6d9.zip |
* vasprintf.c (int_vasprintf): Hack to handle NULL passed for %s.
-rw-r--r-- | gpgme/ChangeLog | 4 | ||||
-rw-r--r-- | gpgme/vasprintf.c | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index 0a31b5c2..2e6f1165 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,3 +1,7 @@ +2002-08-20 Werner Koch <[email protected]> + + * vasprintf.c (int_vasprintf): Hack to handle NULL passed for %s. + 2002-08-20 Marcus Brinkmann <[email protected]> * gpgme.c (_gpgme_set_op_info): Append data on subsequent calls. diff --git a/gpgme/vasprintf.c b/gpgme/vasprintf.c index 9e39966a..30b5e83f 100644 --- a/gpgme/vasprintf.c +++ b/gpgme/vasprintf.c @@ -97,7 +97,13 @@ int_vasprintf (result, format, args) total_width += 307; break; 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; case 'p': case 'n': |