ERRCODE_MASK to handle case where 32bit ints are zero
filled in the gssapi layer.
* error_table.h: Define ERRCODE_MAX, the maximum allowed error
code (32bits).
I am taking the draconian outlook that the com_err library was always
intending to define the error as a 32 bit value. I taken this approach
instead of making the errcode_t machine specific as the com_er
generated header files would then need be machine specific as
well. (error codes are declared as say -4353L explicitly).
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10122
dc483132-0cff-0310-8789-
dd5450dbe970
+Mon Jul 21 12:00:24 1997 Ezra Peisach <epeisach@mit.edu>
+
+ * error_message.c (error_message): Mask error code with
+ ERRCODE_MASK to handle case where 32bit ints are zero
+ filed in the gssapi layer.
+
+ * error_table.h: Define ERRCODE_MAX, the maximum allowed error
+ code (32bits).
+
Tue Mar 18 15:07:40 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
* com_err.h: Add 'extern "C"' for C++ compatibility; also check for
l_offset = (unsigned long)code & ((1<<ERRCODE_RANGE)-1);
offset = l_offset;
- table_num = (unsigned long)code - l_offset;
+ table_num = ((unsigned long)code - l_offset) & ERRCODE_MAX;
if (!table_num) {
if (code == 0)
goto oops;
et = _et_list;
while (et) {
- if (et->table->base == table_num) {
+ if ((et->table->base & ERRCODE_MAX) == table_num) {
/* This is the right table */
if (et->table->n_msgs <= offset)
break;
#define ERRCODE_RANGE 8 /* # of bits to shift table number */
#define BITS_PER_CHAR 6 /* # bits to shift per character in name */
+#define ERRCODE_MAX 0xFFFFFFFF /* Mask for maximum error table */
extern const char FAR *error_table_name ET_P((unsigned long));
extern const char FAR *error_table_name_r ET_P((unsigned long, char FAR *));