]> Git repositories of Nishi - repoview.git/commitdiff
fix
authorNishi <nishi@nishi.boats>
Thu, 22 Aug 2024 02:54:07 +0000 (02:54 +0000)
committerNishi <nishi@nishi.boats>
Thu, 22 Aug 2024 02:54:07 +0000 (02:54 +0000)
git-svn-id: file:///raid/svn-personal/repoview/trunk@36 7e8b2a19-8934-dd40-8cb3-db22cdd5a80f

CGI/avatar.c

index 09201a3ca9cb75e57494d5bb7ea6f8a4196ca8f9..14a8414ee6cb2ad7e8003e6a0d05782b28fb796f 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <png.h>
 
-int hex_to_num(const char* hex, int len) {
+int hex_to_num_len(const char* hex, int len) {
        int i;
        int num = 0;
        for(i = 0; i < len; i++) {
@@ -29,9 +29,9 @@ char* generate_ident(const char* username, int* r, int* g, int* b) {
        char* ident = malloc(25);
        char* hash = rv_md5(username);
 
-       double h = hex_to_num(hash + 32 - 2 - 2 - 3, 3);
-       double s = hex_to_num(hash + 32 - 2 - 2, 2);
-       double v = hex_to_num(hash + 32 - 2, 2);
+       double h = hex_to_num_len(hash + 32 - 2 - 2 - 3, 3);
+       double s = hex_to_num_len(hash + 32 - 2 - 2, 2);
+       double v = hex_to_num_len(hash + 32 - 2, 2);
 
        h = h * 360 / 4095;
        s = 65 - s * 20 / 255;