From cb537b1a9316516567d3fa47283ad4b866265bff Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 17 Feb 2018 21:08:58 +0100 Subject: [PATCH] missing translations are the worst. --- res/core/en/strings.xml | 2 +- src/reports.c | 8 ++++++-- src/util/language.c | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/res/core/en/strings.xml b/res/core/en/strings.xml index 0347e92b5..096dace78 100644 --- a/res/core/en/strings.xml +++ b/res/core/en/strings.xml @@ -1081,7 +1081,7 @@ water of life - + waters of life diff --git a/src/reports.c b/src/reports.c index 20f2068e8..992e6de9f 100644 --- a/src/reports.c +++ b/src/reports.c @@ -2114,10 +2114,14 @@ static void eval_resource(struct opstack **stack, const void *userdata) int j = opop(stack).i; const struct resource_type *res = (const struct resource_type *)opop(stack).v; const char *c = LOC(lang, resourcename(res, j != 1)); - size_t len = strlen(c); variant var; + if (c) { + size_t len = strlen(c); - var.v = strcpy(balloc(len + 1), c); + var.v = strcpy(balloc(len + 1), c); + } else { + var.v = NULL; + } opush(stack, var); } diff --git a/src/util/language.c b/src/util/language.c index cf76dc4de..b2447b695 100644 --- a/src/util/language.c +++ b/src/util/language.c @@ -186,7 +186,7 @@ const char *locale_string(const locale * lang, const char *key, bool warn) return value; } } - return 0; + return NULL; } void locale_setstring(locale * lang, const char *key, const char *value)