Browse Source

Fixed a wrong check on stat return value

Marco Bambini 5 years ago
parent
commit
77c8b403cb
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/utils/gravity_utils.c

+ 1 - 1
src/utils/gravity_utils.c

@@ -125,7 +125,7 @@ uint64_t file_size (const char *path) {
     return (uint64_t)(((__int64)fileInfo.nFileSizeHigh) << 32 ) + fileInfo.nFileSizeLow;
     #else
     struct stat sb;
-    if (stat(path, &sb) > 0) return -1;
+    if (stat(path, &sb) < 0) return -1;
     return (uint64_t)sb.st_size;
     #endif
 }