summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-08-09 05:28:02 +0000
committerRichard M. Stallman <rms@gnu.org>1998-08-09 05:28:02 +0000
commitb7305fdc0b1b2c7e45fca0e4b187defa4640579e (patch)
tree561078d15af1eb34f987c257a2650749ea06f32d
parent3425ef76990d9cb669b99feecf6a181260d6a241 (diff)
downloademacs-b7305fdc0b1b2c7e45fca0e4b187defa4640579e.tar.gz
(CHARSET_OK): Check that coding_system_table[IDX] != 0.
-rw-r--r--src/coding.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/coding.c b/src/coding.c
index 7c693b86b1c..7e00f4a60fa 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -652,11 +652,12 @@ detect_coding_emacs_mule (src, src_end)
enum iso_code_class_type iso_code_class[256];
-#define CHARSET_OK(idx, charset) \
- (coding_system_table[idx]->safe_charsets[charset] \
- || (CODING_SPEC_ISO_REQUESTED_DESIGNATION \
- (coding_system_table[idx], charset) \
- != CODING_SPEC_ISO_NO_REQUESTED_DESIGNATION))
+#define CHARSET_OK(idx, charset) \
+ (coding_system_table[idx] \
+ && (coding_system_table[idx]->safe_charsets[charset] \
+ || (CODING_SPEC_ISO_REQUESTED_DESIGNATION \
+ (coding_system_table[idx], charset) \
+ != CODING_SPEC_ISO_NO_REQUESTED_DESIGNATION)))
#define SHIFT_OUT_OK(idx) \
(CODING_SPEC_ISO_INITIAL_DESIGNATION (coding_system_table[idx], 1) >= 0)