fate/api-h264-slice-test: don't use ssize_t
authorJosh de Kock <joshdk@obe.tv>
Tue, 30 Oct 2018 14:38:41 +0000 (14:38 +0000)
committerJames Almer <jamrial@gmail.com>
Sat, 3 Nov 2018 15:46:45 +0000 (12:46 -0300)
Fixes ticket #7521

Signed-off-by: James Almer <jamrial@gmail.com>
tests/api/api-h264-slice-test.c

index 57e7dc7..e68fa6e 100644 (file)
@@ -180,15 +180,12 @@ int main(int argc, char **argv)
 
     while(1) {
         uint16_t size = 0;
-        ssize_t ret = fread(&size, 1, sizeof(uint16_t), fd);
-        if (ret < 0) {
-            perror("Couldn't read size");
-            exit(1);
-        } else if (ret != sizeof(uint16_t))
+        size_t ret = fread(&size, 1, sizeof(uint16_t), fd);
+        if (ret != sizeof(uint16_t))
             break;
         size = ntohs(size);
         ret = fread(p, 1, size, fd);
-        if (ret < 0 || ret != size) {
+        if (ret != size) {
             perror("Couldn't read data");
             exit(1);
         }