save bpph list into file cache
[ppastats.git] / src / fcache.c
index 1a4623c..2f76486 100644 (file)
@@ -67,7 +67,7 @@ static char *key_to_path(const char *key)
                return NULL;
 
        path = malloc(strlen(dir) + 1 + strlen(key) + strlen("/data") + 1);
-       sprintf(path, "%s%s/data", dir, key);
+       sprintf(path, "%s%s.data", dir, key);
 
        return path;
 }
@@ -83,18 +83,18 @@ char *fcache_get(const char *key)
        }
 
        content = file_get_content(path);
-       
+
        if (content)
                log_debug(_("file cache hit %s"), key);
        else
                log_debug(_("file cache miss %s %s"), key, path);
-       
+
        free(path);
-       
+
        return content;
 }
-       
-void fcache_put(const char *key, char *value)
+
+void fcache_put(const char *key, const char *value)
 {
        char *path, *dir, *tmp;
        FILE *f;