From 6118781f7f5dba672d19a841cc231661bf5fb59d Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 17 Jan 2013 19:27:20 -0600 Subject: [PATCH] Fix readlink failure As reported by Raimund Steger. --- src/fcdefault.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fcdefault.c b/src/fcdefault.c index b1bd9cc..d1217a4 100644 --- a/src/fcdefault.c +++ b/src/fcdefault.c @@ -148,11 +148,11 @@ retry: prgname = FcStrdup (""); #else char buf[PATH_MAX + 1]; - unsigned int len; + int len; char *p = NULL; len = readlink ("/proc/self/exe", buf, sizeof (buf) - 1); - if (len > 0) + if (len != -1) { buf[len] = '\0'; p = buf;