ayttm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ayttm-commits] CVS: ayttm/modules/workwizu workwizu.c,1.4,1.5


From: Colin Leroy <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/modules/workwizu workwizu.c,1.4,1.5
Date: Thu, 09 Jan 2003 08:39:28 -0500

Update of /cvsroot/ayttm/ayttm/modules/workwizu
In directory subversions:/tmp/cvs-serv13406/modules/workwizu

Modified Files:
        workwizu.c 
Log Message:
fix type overflow


Index: workwizu.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/workwizu/workwizu.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- workwizu.c  9 Jan 2003 00:50:50 -0000       1.4
+++ workwizu.c  9 Jan 2003 13:39:26 -0000       1.5
@@ -187,28 +187,28 @@
        return (ref_count > 0 && account->online);
 }
 
-
-unsigned long getHash (char *s) 
+unsigned long long getHash (char *s) 
 {
-       long hash = 0;
-       unsigned long res = 0;
+       long long hash = 0;
+       unsigned long long res = 0;
        int i = 0;
        for (i=0; i < strlen(s); i++) {
                int c = (int)s[i];
                int x = strlen(s);
                int l = x-(i+1);
-               int p = pow(31,l);
+               long long p = pow(31,l);
                hash += c*p;  /* 31^(strlen(s)-(1+1)) */
        }
        if (hash < 0) res = -hash;
        else res = hash;
+       eb_debug(DBG_MOD,"getHash %llu \n", res);
        return res;
 }
 
 char *compute_challenge() 
 {
        char *result_c = NULL;
-       unsigned long hash;
+       unsigned long long hash;
        mpz_t beta;
        mpz_t result;
        mpz_t challenge;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]