]> gitweb.michael.orlitzky.com - apply-default-acl.git/blobdiff - src/libadacl.c
src/libadacl.c: remove redundant empty pathname checks from safe_open().
[apply-default-acl.git] / src / libadacl.c
index e75fdece6a36edd7ece544944ffa920a64970d04..30a39f2704883a60429abd279a05c99caeb9b0c9 100644 (file)
@@ -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;