]> git.wh0rd.org - fontconfig.git/blobdiff - fc-cat/fc-cat.c
Compare device numbers as well as inodes. Always normalize directory names
[fontconfig.git] / fc-cat / fc-cat.c
index 419d29ffeabaa6b83cd2060fda1a51d49b6a45c6..3b24302dee0805d61dd079c21030fdfaf71f2bdb 100644 (file)
@@ -205,7 +205,11 @@ FcCacheGlobalFileReadAndPrint (FcFontSet * set, FcStrSet *dirs, char *cache_file
        if (!FcDirCacheConsume (fd, name_buf, set, 0))
            goto bail1;
 
-       dir = strdup(name_buf);
+       dir = malloc (strlen (name_buf) + 2);
+       if (!dir)
+           goto bail1;
+
+       strcpy (dir, name_buf);
        strcat (dir, "/");
 
        FcCachePrintSet (set, dirs, dir);