From: Michael Gernoth Date: Sat, 19 May 2007 13:15:27 +0000 (+0200) Subject: better check for NULL on access X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/usb-driver/commitdiff_plain/b8b756f5d39ddfb395832493e69924e015a28588?hp=2c6ade7a8a066959e735f699b320c24c6a8c58c0 better check for NULL on access --- diff --git a/usb-driver.c b/usb-driver.c index 18d6331..be3b94f 100644 --- a/usb-driver.c +++ b/usb-driver.c @@ -891,10 +891,7 @@ int access(const char *pathname, int mode) { if (!func) func = (int (*) (const char*, int)) dlsym(RTLD_NEXT, "access"); - if (!pathname) - return -1; - - if (!strcmp(pathname, "/dev/windrvr6")) { + if (pathname && !strcmp(pathname, "/dev/windrvr6")) { return 0; } else { return (*func)(pathname, mode);