Fix issues detected by static analysis tool
[platform/upstream/libxkbcommon.git] / test / common.c
index cb911e8..0bed3de 100644 (file)
@@ -260,7 +260,7 @@ test_read_file(const char *path_rel)
 
     remaining = info.st_size;
     tmp = ret;
-    while ((count = read(fd, tmp, remaining))) {
+    while ((count = read(fd, tmp, remaining)) > 0) {
         remaining -= count;
         tmp += count;
     }