From 0ac2c2991c1cba4e3c6e5f7b62c7d61b01d69994 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 7 Mar 2011 16:46:23 -0800 Subject: [PATCH] * charset.c (load_charset): Abort instead of using uninitialized var. --- src/ChangeLog | 1 + src/charset.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c108bb38bea..02dc5390f38 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -36,6 +36,7 @@ and to avoid gcc -Wuninitialized warning. (load_charset_map): Mark variables that gcc -Wuninitialized does not deduce are never used uninitialized. + (load_charset): Abort instead of using uninitialized var. 2011-03-06 Chong Yidong diff --git a/src/charset.c b/src/charset.c index e46dadab93a..d82b29ae44b 100644 --- a/src/charset.c +++ b/src/charset.c @@ -630,8 +630,12 @@ load_charset (struct charset *charset, int control_flag) if (CHARSET_METHOD (charset) == CHARSET_METHOD_MAP) map = CHARSET_MAP (charset); - else if (CHARSET_UNIFIED_P (charset)) - map = CHARSET_UNIFY_MAP (charset); + else + { + if (! CHARSET_UNIFIED_P (charset)) + abort (); + map = CHARSET_UNIFY_MAP (charset); + } if (STRINGP (map)) load_charset_map_from_file (charset, map, control_flag); else -- 2.39.5