Fix for bug 87865 r=nelsonb,mcgreer
authorjavi%netscape.com
Thu, 28 Jun 2001 00:05:55 +0000
changeset 1690 83f046607cd57ebd962338be25aca37ee3a1a14a
parent 1687 ac83686cb0734369586f8a30f17ad7c2188eb8f3
child 1692 135832df412bc1265cb18e815c4daa96858adb04
push idunknown
push userunknown
push dateunknown
reviewersnelsonb, mcgreer
bugs87865
Fix for bug 87865 r=nelsonb,mcgreer Use the constant SIEVE_SIZE instead of the sizeof operator since the type for the variable sieve is different on the Mac.
security/nss/lib/freebl/mpi/mpprime.c
--- a/security/nss/lib/freebl/mpi/mpprime.c
+++ b/security/nss/lib/freebl/mpi/mpprime.c
@@ -475,32 +475,32 @@ mp_err mpp_make_prime(mp_int *start, mp_
     --nBits;
   MP_CHECKOK( mpl_set_bit(start, nBits - 1, 1) );
   MP_CHECKOK( mpl_set_bit(start,         0, 1) );
   for (i = mpl_significant_bits(start) - 1; i >= nBits; --i) {
     MP_CHECKOK( mpl_set_bit(start, i, 0) );
   }
   /* start sieveing with prime value of 3. */
   MP_CHECKOK(mpp_sieve(start, prime_tab + 1, prime_tab_size - 1, 
-		       sieve, sizeof sieve) );
+		       sieve, SIEVE_SIZE) );
 
 #ifdef DEBUG_SIEVE
   res = 0;
-  for (i = 0; i < sizeof sieve; ++i) {
+  for (i = 0; i < SIEVE_SIZE; ++i) {
     if (!sieve[i])
       ++res;
   }
   fprintf(stderr,"sieve found %d potential primes.\n", res);
 #define FPUTC(x,y) fputc(x,y)
 #else
 #define FPUTC(x,y) 
 #endif
 
   res = MP_NO;
-  for(i = 0; i < sizeof sieve; ++i) {
+  for(i = 0; i < SIEVE_SIZE; ++i) {
     if (sieve[i])	/* this number is composite */
       continue;
     MP_CHECKOK( mp_add_d(start, 2 * i, &trial) );
     FPUTC('.', stderr);
     /* run a Fermat test */
     res = mpp_fermat(&trial, 2);
     if (res != MP_OKAY) {
       if (res == MP_NO)