final < countof(chlook->charset_by_attributes[0])
&& dir <
countof(chlook->charset_by_attributes[0][0]));
- return chlook->charset_by_attributes[type][final][dir];
+#if defined(SXEMACS_DEBUG) && SXEMACS_DEBUG
+ if( dir < 0 || ! final < 128 || ! type < 4 ) {
+ abort();
+ return Qnil;
+ } else
+#endif
+ return chlook->charset_by_attributes[type][final][dir];
}
/* Table of number of bytes in the string representation of a character
extern_inline int REP_BYTES_BY_FIRST_BYTE(Bufbyte fb);
extern_inline int REP_BYTES_BY_FIRST_BYTE(Bufbyte fb)
{
- type_checking_assert(fb < 0xA0);
- return rep_bytes_by_first_byte[fb];
+ int inbounds = (fb < (sizeof(rep_bytes_by_first_byte)/sizeof(Bytecount)));
+ type_checking_assert(inbounds);
+ if(inbounds)
+ return rep_bytes_by_first_byte[fb];
+ else
+ return 1;
}
\f
/************************************************************************/