Explorar o código

Fixed a wrong check on stat return value

Marco Bambini %!s(int64=5) %!d(string=hai) anos
pai
achega
77c8b403cb
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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
 }