Changeset 628 for trollforge


Ignore:
Timestamp:
01/19/12 02:20:29 (16 months ago)
Author:
literalka
Message:

i dont even know if this works correctly lol

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trollforge/lastmeasure/server/lmutil.h

    r627 r628  
    8484        md5((unsigned char*)hosthash,8,(unsigned char*)hash); 
    8585 
    86         sprintf(buffer, "%08lx", (0xffffffff - t)); 
     86        sprintf(buffer, "%lx", (0xffffffff - t)); 
    8787        strcat(buffer,hash); 
    8888 
     
    9191 
    9292    /* Get back the date value from a key */ 
    93     static std::string KeyToDate(char const $key) 
     93    static std::string KeyToDate(char const *key) 
    9494    { 
    95         std::stringstream ret(""); 
    96         // return 0xffffffff - hexdec(substr($key, 0, 8)); 
    97         return ret.str(); 
     95        char buffer[8]; 
     96        char prekey[8]; 
     97 
     98        strncpy(prekey,key,8); 
     99        int hexkey = atoi(prekey); 
     100        sprintf(buffer, "%c", 0xffffffff - hexkey); 
     101 
     102        return buffer; 
    98103    } 
    99104 
Note: See TracChangeset for help on using the changeset viewer.