From bf76fa312c71a79a8ca9fd6a89ad6fe3a71cc677 Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Tue, 16 Aug 2011 20:55:42 +1000 Subject: [PATCH] Assume MOD_POSIX_CURRENCY_SYMBOL contains only ASCII characters The GNU library now has "C.UTF-8" as a locale (which is NOT a single-byte locale!), but we assume the currency symbol in MOD_POSIX_CURRENCY_SYMBOL contains only ASCII characters. --- src/utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils.c b/src/utils.c index d106c72..20c2e2c 100644 --- a/src/utils.c +++ b/src/utils.c @@ -345,9 +345,9 @@ ssize_t l_strfmon (char *restrict s, size_t maxsize, if (strstr(format, "!") == NULL) { /* Insert lconvinfo.currency_symbol to s. - NB: add_currecy_symbol == true assumes POSIX locale: - single-byte strings are in effect, so strlen(), etc, work - correctly. */ + NB: add_currecy_symbol == true assumes a POSIX locale and + that MOD_POSIX_CURRENCY_SYMBOL contains only ASCII-safe + characters that work with strlen(), etc. */ const char *sym = lconvinfo.currency_symbol; int symlen = strlen(sym); char *p;