From bd5fe7593fd0df236f3b2be1f062166ddba7d67c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 16 Oct 2018 09:42:51 +1000 Subject: [PATCH] xfree86: fix readlink call Misplaced parenthesis caused us to compare the sizeof, not the readlink return value. Signed-off-by: Peter Hutterer --- hw/xfree86/fbdevhw/fbdevhw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c index 3fb1d2bba..95089515c 100644 --- a/hw/xfree86/fbdevhw/fbdevhw.c +++ b/hw/xfree86/fbdevhw/fbdevhw.c @@ -336,7 +336,7 @@ fbdev_open(int scrnIndex, const char *dev, char **namep) char *node = strrchr(dev, '/') + 1; if (asprintf(&sysfs_path, "/sys/class/graphics/%s", node) < 0 || - readlink(sysfs_path, buf, sizeof(buf) < 0) || + readlink(sysfs_path, buf, sizeof(buf)) < 0 || strstr(buf, "devices/pci")) { free(sysfs_path); close(fd);