summaryrefslogtreecommitdiff
path: root/fc-cat
diff options
context:
space:
mode:
Diffstat (limited to 'fc-cat')
-rw-r--r--fc-cat/fc-cat.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fc-cat/fc-cat.c b/fc-cat/fc-cat.c
index 80c381c0..09b20f66 100644
--- a/fc-cat/fc-cat.c
+++ b/fc-cat/fc-cat.c
@@ -244,6 +244,7 @@ FcCacheFileRead (FcFontSet * set, FcStrSet *dirs, char *cache_file)
char subdirName[FC_MAX_FILE_LEN + 1 + 12 + 1];
static char name_buf[8192], *dir;
FcChar8 * ls;
+ char * buf;
if (!cache_file)
goto bail;
@@ -265,7 +266,8 @@ FcCacheFileRead (FcFontSet * set, FcStrSet *dirs, char *cache_file)
if (current_arch_start < 0)
goto bail1;
- while (strlen(FcCacheReadString (fd, subdirName, sizeof (subdirName))) > 0)
+ while ((buf = FcCacheReadString (fd, subdirName, sizeof (subdirName)))
+ && *buf)
FcStrSetAdd (dirs, (FcChar8 *)subdirName);
dir = strdup(name_buf);