From ad5a9de93a8cfe261636993532246befddea984d Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Mon, 29 Oct 2018 22:11:54 +0100
Subject: [PATCH] tests/api-h264-slice-test: fread returns size_t, not
ssize_t.
Fixes ticket #7521.
---
tests/api/api-h264-slice-test.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
@@ -180,15 +180,15 @@ 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) {
+ size_t ret = fread(&size, 1, sizeof(uint16_t), fd);
+ if (!ret) {
perror("Couldn't read size");
exit(1);
} else 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);
}
--
1.7.10.4