History

test/libmpv_encode: check fread return value

Fixes warning with clang

llyyr committed 2 years ago

Commit f89d0d41 parent 6c59b021 file · +3 −3Browse files

Unified · Split

test/libmpv_encode.c+3−3
@@ -94,11 +94,11 @@ static void check_output(FILE *fp) · 93 unmodified lines
94 if (size < 100)94 if (size < 100)
95 fail("did not encode anything\n");95 fail("did not encode anything\n");
96 96
97 char magic[4] = {0};97 char magic[4];
98 fseek(fp, 0, SEEK_SET);98 fseek(fp, 0, SEEK_SET);
99 fread(magic, sizeof(magic), 1, fp);99 size_t ret = fread(magic, sizeof(magic), 1, fp);
100 static const char ebml_magic[] = {26, 69, 223, 163};100 static const char ebml_magic[] = {26, 69, 223, 163};
101 if (memcmp(magic, ebml_magic, 4) != 0)101 if (ret != 1 || memcmp(magic, ebml_magic, sizeof(magic)) != 0)
102 fail("output was not Matroska\n");102 fail("output was not Matroska\n");
103 103
104 puts("output file ok");104 puts("output file ok");

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t