open, openat: minor optimization
[pspp] / lib / openat.c
index 7e46a2672be613f948bae41dd30b78de4ed63b45..079039fee3a40d29377c1b9e8463e970f87601b6 100644 (file)
@@ -103,8 +103,9 @@ rpl_openat (int dfd, char const *filename, int flags, ...)
      with ENOTDIR.  */
   if (fd >= 0)
     {
+      /* We know len is positive, since open did not fail with ENOENT.  */
       size_t len = strlen (filename);
-      if (len > 0 && filename[len - 1] == '/')
+      if (filename[len - 1] == '/')
        {
          struct stat statbuf;