1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

common: Let format_text return an error.

* common/stringhelp.c (format_text): Return NULL on error.
* common/t-stringhelp.c (test_format_text): Adjust for change.
* g10/gpgcompose.c (show_help): Abort on out of core.
* g10/tofu.c (ask_about_binding): Abort on format_text error.
(show_statistics): Ditto.
(show_warning): Ditto.
--

For better re-usability function in common/ shot  better not use
xmalloc functions.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2017-05-15 09:58:27 +02:00
parent bc01d62dc5
commit 00b7767bc6
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
4 changed files with 39 additions and 18 deletions

View file

@ -306,6 +306,8 @@ show_help (struct option options[])
if (! option)
space = 72;
formatted = format_text (tmp, space, space + 4);
if (!format_text)
abort ();
if (tmp != help)
xfree (tmp);