aboutsummaryrefslogtreecommitdiffstats
path: root/common/t-stringhelp.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2017-05-15 07:58:27 +0000
committerWerner Koch <[email protected]>2017-05-15 07:58:27 +0000
commit00b7767bc6fe309aa20375c859ebf708cfc7b9ea (patch)
tree95049d0230b05b0beb4520e166a450bff9dd6b86 /common/t-stringhelp.c
parenttests: Also run all OpenPGP tests using keyrings. (diff)
downloadgnupg-00b7767bc6fe309aa20375c859ebf708cfc7b9ea.tar.gz
gnupg-00b7767bc6fe309aa20375c859ebf708cfc7b9ea.zip
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 <[email protected]>
Diffstat (limited to 'common/t-stringhelp.c')
-rw-r--r--common/t-stringhelp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/t-stringhelp.c b/common/t-stringhelp.c
index 869ca56f0..189fed1f9 100644
--- a/common/t-stringhelp.c
+++ b/common/t-stringhelp.c
@@ -886,6 +886,11 @@ test_format_text (void)
struct test *test = &tests[i];
char *result =
format_text (test->input, test->target_cols, test->max_cols);
+ if (!result)
+ {
+ fail (1);
+ exit (2);
+ }
if (strcmp (result, test->expected) != 0)
{
printf ("%s: Test #%d failed.\nExpected: '%s'\nResult: '%s'\n",