commit a72ba44a33bd863a4e92f4253dc7602014c1d5f8
parent 0208fc5ef550a94c7a4a09fde0242b40996f804f
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Sat, 12 Aug 2023 09:26:42 +0200
-fix -l option
Diffstat:
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/contrib/taler-terms-generator.in b/contrib/taler-terms-generator.in
@@ -167,7 +167,7 @@ fi
if [ -n "${ADD_LANGUAGE+x}" ]
then
- if echo "${ADD_LANGUAGE}" | grep -e '..' > /dev/null
+ if ! echo "${ADD_LANGUAGE}" | grep -e '^..$' > /dev/null
then
echo "Error: Invalid language '${ADD_LANGUAGE}'. Two characters (en, de, fr, ...) expected." 1>&2
exit 1
diff --git a/src/json/json_helper.c b/src/json/json_helper.c
@@ -1261,8 +1261,11 @@ i18n_cleaner (void *cls,
struct I18nContext *ctx = cls;
(void) spec;
- GNUNET_free (ctx->lp);
- GNUNET_free (ctx);
+ if (NULL != ctx)
+ {
+ GNUNET_free (ctx->lp);
+ GNUNET_free (ctx);
+ }
}
@@ -1282,8 +1285,9 @@ TALER_JSON_spec_i18n_string (const char *name,
.size_ptr = NULL
};
- ctx->lp = (NULL != language_pattern) ? GNUNET_strdup (language_pattern) :
- NULL;
+ ctx->lp = (NULL != language_pattern)
+ ? GNUNET_strdup (language_pattern)
+ : NULL;
ctx->field = name;
*strptr = NULL;
return ret;