diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2020-10-03 14:20:07 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2020-10-03 14:20:07 +0100 |
commit | 2b2469df7ef088d219a8bc911769ffde149c1129 (patch) | |
tree | 925a21040ccdcbef5ec0cb7415da8d463dd5bbb1 | |
parent | 926e560716c56aa0ee6492478ead15f9e6c07fe2 (diff) | |
download | netsurf-2b2469df7ef088d219a8bc911769ffde149c1129.tar.gz netsurf-2b2469df7ef088d219a8bc911769ffde149c1129.tar.bz2 |
split-messages: Handle gzprintf failing
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
-rw-r--r-- | tools/split-messages.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/split-messages.c b/tools/split-messages.c index 0bce7397f..73a95e153 100644 --- a/tools/split-messages.c +++ b/tools/split-messages.c @@ -500,13 +500,21 @@ message_write(struct param *param, struct trnsltn_entry *tlist) return NSERROR_PERMISSION; } - gzprintf(outf, + if (gzprintf(outf, "# This messages file is automatically generated from %s\n" "# at build-time. Please go and edit that instead of this.\n\n", - param->infilename); + param->infilename) < 1) { + gzclose(outf); + unlink(param->outfilename); + return NSERROR_NOSPACE; + }; while (tlist != NULL) { - gzprintf(outf, "%s:%s\n", tlist->key, tlist->value); + if (gzprintf(outf, "%s:%s\n", tlist->key, tlist->value) < 1) { + gzclose(outf); + unlink(param->outfilename); + return NSERROR_NOSPACE; + } tlist = tlist->next; } |