Commit a1159318 authored by Michael Niedermayer's avatar Michael Niedermayer

ffadler: add multifile support

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 3d66ce17
...@@ -36,15 +36,15 @@ ...@@ -36,15 +36,15 @@
#define SIZE 65536 #define SIZE 65536
int main(int argc, char **argv) static int check(char *file)
{ {
uint8_t buffer[SIZE]; uint8_t buffer[SIZE];
uint32_t checksum = 1; uint32_t checksum = 1;
int fd; int fd;
int ret = 0; int ret = 0;
if (argc > 1) fd = open(argv[1], O_RDONLY); if (file) fd = open(file, O_RDONLY);
else fd = 0; else fd = 0;
if (fd == -1) { if (fd == -1) {
printf("A32=OPEN-FAILED-%d\n", errno); printf("A32=OPEN-FAILED-%d\n", errno);
ret = 1; ret = 1;
...@@ -65,9 +65,23 @@ int main(int argc, char **argv) ...@@ -65,9 +65,23 @@ int main(int argc, char **argv)
printf("A32=0x%08x", checksum); printf("A32=0x%08x", checksum);
end: end:
if (argc > 1) if (file)
printf(" *%s", argv[1]); printf(" *%s", file);
printf("\n"); printf("\n");
return ret; return ret;
} }
int main(int argc, char **argv)
{
int i;
int ret = 0;
for (i = 1; i<argc; i++)
ret |= check(argv[i]);
if (argc == 1)
ret |= check(NULL);
return ret;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment