Fix references to non-standard SIZE_T_MAX
Turns out C99 doesn't define SIZE_T_MAX, so let's not use it.
diff --git a/library/bignum.c b/library/bignum.c
index 9544dc9..14a3dc7 100644
--- a/library/bignum.c
+++ b/library/bignum.c
@@ -34,7 +34,6 @@
#include "polarssl/bignum.h"
#include "polarssl/bn_mul.h"
-#include <limits.h>
#include <stdlib.h>
/* Implementation that should never be optimized out by the compiler */
@@ -46,6 +45,8 @@
#define biL (ciL << 3) /* bits in limb */
#define biH (ciL << 2) /* half limb size */
+#define MPI_SIZE_T_MAX ( (size_t) -1 ) /* SIZE_T_MAX is not standard */
+
/*
* Convert between bits/chars and number of limbs
* Divide first in order to avoid potential overflows
@@ -289,7 +290,7 @@
if( radix == 16 )
{
- if( slen > SIZE_T_MAX >> 2 )
+ if( slen > MPI_SIZE_T_MAX >> 2 )
return( POLARSSL_ERR_MPI_BAD_INPUT_DATA );
n = BITS_TO_LIMBS( slen << 2 );