* bugfix in the hash implementation; expanding the hash wasn't done properly
[citadel.git] / libcitadel / lib / mime_parser.c
index 14f292a6def95a637e5fe9275f2804e03a21f88a..b60b18beb63994b8d2722dc77550f789b76d5a1f 100644 (file)
@@ -778,7 +778,7 @@ int LoadIconDir(const char *DirName)
        IconName *Icon;
 
        filedir = opendir (DirName);
-       IconHash = NewHash();
+       IconHash = NewHash(1, NULL);
        if (filedir == NULL) {
                return 0;
        }
@@ -842,19 +842,21 @@ int LoadIconDir(const char *DirName)
 
 const char *GetIconFilename(char *MimeType, size_t len)
 {
+       void *vIcon;
        IconName *Icon;
        
        if(IconHash == NULL)
                return NULL;
 
-       GetHash(IconHash, MimeType, len, (void**)&Icon);
+       GetHash(IconHash, MimeType, len, &vIcon), Icon = (IconName*) vIcon;
        /* didn't find the exact mimetype? try major only. */
        if (Icon == NULL) {
                char * pMinor;
                pMinor = strchr(MimeType, '/');
                if (pMinor != NULL) {
                        *pMinor = '\0';
-                       GetHash(IconHash, MimeType, pMinor - MimeType, (void**)&Icon);
+                       GetHash(IconHash, MimeType, pMinor - MimeType, &vIcon),
+                               Icon = (IconName*) vIcon;
                }
        }
        if (Icon == NULL) {