-#define CATEGORY_SET(c) \
- Faref (current_buffer->category_table, \
- COMPOSITE_CHAR_P (c) ? cmpchar_component (c, 0) : (c))
+#define CATEGORY_SET(c) \
+ ((c) < CHAR_TABLE_SINGLE_BYTE_SLOTS \
+ ? Faref (current_buffer->category_table, make_number ((unsigned char) c)) \
+ : Faref (current_buffer->category_table, \
+ COMPOSITE_CHAR_P (c) ? cmpchar_component ((c), 0) : (c)))