* Yup, that's it ... the expression (long)*(cdboi->ptr) does NOT work reliably...
authorArt Cancro <ajc@citadel.org>
Sun, 11 Oct 2009 03:45:23 +0000 (03:45 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 11 Oct 2009 03:45:23 +0000 (03:45 +0000)
citadel/modules/expire/serv_expire.c

index 32b6d270cf6c939a690d59d6c41c984811d9fc7e..ab1d3a35909d765021bd681c00e6b0f40e0f9839 100644 (file)
@@ -806,6 +806,7 @@ int PurgeStaleOpenIDassociations(void) {
        void *Value;
        const char *Key;
        int num_deleted = 0;
+       long usernum = 0L;
 
        keys = NewHash(1, NULL);
        if (!keys) return(0);
@@ -814,15 +815,7 @@ int PurgeStaleOpenIDassociations(void) {
        cdb_rewind(CDB_OPENID);
        while (cdboi = cdb_next_item(CDB_OPENID), cdboi != NULL) {
                if (cdboi->len > sizeof(long)) {
-                       long usernum;
-                       usernum = ((long)*(cdboi->ptr));
-                       /* FIXME two different things here, trying to figure out whether this is the
-                        * source of a bug.
-                        */
-                       CtdlLogPrintf(CTDL_DEBUG, "#1 Evaluating openid association for user %ld\n", usernum);
-                       usernum = 0;
                        memcpy(&usernum, cdboi->ptr, sizeof(long));
-                       CtdlLogPrintf(CTDL_DEBUG, "#2 Evaluating openid association for user %ld\n", usernum);
                        if (getuserbynumber(&usbuf, usernum) != 0) {
                                deleteme = strdup(cdboi->ptr + sizeof(long)),
                                Put(keys, deleteme, strlen(deleteme), deleteme, generic_free_handler);