(der_length_size, der_write_length): Test INT_MAX instead of SIZEOF_INT.
(der_read_length): Test sizeof(int) instead of SIZEOF_INT.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17812
dc483132-0cff-0310-8789-
dd5450dbe970
+2006-03-30 Ken Raeburn <raeburn@mit.edu>
+
+ * util_token.c: Include limits.h.
+ (der_length_size, der_write_length): Test INT_MAX instead of
+ SIZEOF_INT.
+ (der_read_length): Test sizeof(int) instead of SIZEOF_INT.
+
2006-03-27 Ken Raeburn <raeburn@mit.edu>
* Makefile.in (include_xom): Define as "rem" instead of empty on
#ifdef HAVE_MEMORY_H
#include <memory.h>
#endif
+#include <limits.h>
/*
* $Id$
return(1);
else if (length < (1<<8))
return(2);
-#if (SIZEOF_INT == 2)
+#if INT_MAX == 0x7fff
else
return(3);
#else
*(*buf)++ = (unsigned char) length;
} else {
*(*buf)++ = (unsigned char) (der_length_size(length)+127);
-#if (SIZEOF_INT > 2)
+#if INT_MAX > 0x7fff
if (length >= (1<<24))
*(*buf)++ = (unsigned char) (length>>24);
if (length >= (1<<16))
if (sf & 0x80) {
if ((sf &= 0x7f) > ((*bufsize)-1))
return(-1);
- if (sf > SIZEOF_INT)
+ if (sf > sizeof(int))
return (-1);
ret = 0;
for (; sf; sf--) {