From c0dc8f64a9adeab709cf22468d80afe97d7ad50d Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 5 Jun 2008 05:45:16 +0000 Subject: [PATCH] (MAKE_CHAR_MULTIBYTE): Check the arg is a (uni)byte. --- src/ChangeLog | 2 ++ src/character.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 178e5b38969..c564066d0b2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2008-06-05 Stefan Monnier + * character.h (MAKE_CHAR_MULTIBYTE): Check the arg is a (uni)byte. + * keymap.c (Vminibuffer_local_filename_must_match_map): Rename from Vminibuffer_local_must_match_filename_map. (syms_of_keymap): diff --git a/src/character.h b/src/character.h index ce36cdf85ff..ae87b3885d9 100644 --- a/src/character.h +++ b/src/character.h @@ -95,7 +95,8 @@ extern char unibyte_has_multibyte_table[256]; /* If C is not ASCII, make it multibyte. It assumes C < 256. */ -#define MAKE_CHAR_MULTIBYTE(c) ((c) = unibyte_to_multibyte_table[(c)]) +#define MAKE_CHAR_MULTIBYTE(c) \ + (eassert ((c) >= 0 && (c) < 256), (c) = unibyte_to_multibyte_table[(c)]) /* This is the maximum byte length of multibyte form. */ #define MAX_MULTIBYTE_LENGTH 5