Fix readlink failure

As reported by Raimund Steger.
This commit is contained in:
Behdad Esfahbod 2013-01-17 19:27:20 -06:00
parent 671bcb34e2
commit 6118781f7f
1 changed files with 2 additions and 2 deletions

View File

@ -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;