X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2Flibadacl.c;h=30a39f2704883a60429abd279a05c99caeb9b0c9;hb=b13aa67306336a89d9947735622c547c13acffb6;hp=e75fdece6a36edd7ece544944ffa920a64970d04;hpb=0ff54b9d02fab3c36c91d5e26d280417521fe198;p=apply-default-acl.git diff --git a/src/libadacl.c b/src/libadacl.c index e75fdec..30a39f2 100644 --- a/src/libadacl.c +++ b/src/libadacl.c @@ -69,7 +69,7 @@ int safe_open_ex(int at_fd, char* pathname, int flags) { /* No more slashes, this is the base case. */ return openat(at_fd, pathname, flags); } - else if (firstslash[1] == '\0') { + if (firstslash[1] == '\0') { /* The first slash is the last character; ensure that we open a directory. */ firstslash[0] = '\0'; @@ -127,7 +127,7 @@ int safe_open_ex(int at_fd, char* pathname, int flags) { * and @c OPEN_ERROR if not. */ int safe_open(const char* pathname, int flags) { - if (pathname == NULL || strlen(pathname) == 0 || pathname[0] == '\0') { + if (pathname == NULL) { errno = EINVAL; perror("safe_open (args)"); return OPEN_ERROR;