]> git.sur5r.net Git - cc65/blob - test/bdiff.c
Fixed _textcolor definition.
[cc65] / test / bdiff.c
1
2 // minimal tool to compare two binaries
3
4 #include <stdlib.h>
5 #include <stdio.h>
6
7 int main(int argc, char *argv[])
8 {
9     FILE *f1, *f2;
10     if (argc < 3) {
11         return EXIT_FAILURE;
12     }
13     f1 = fopen(argv[1], "rb");
14     f2 = fopen(argv[2], "rb");
15     if ((f1 == NULL) || (f2 == NULL)) {
16         return EXIT_FAILURE;
17     }
18     for(;;) {
19         if (feof(f1) && feof(f2)) {
20             return EXIT_SUCCESS;
21         } else if (feof(f1) || feof(f2)) {
22             return EXIT_FAILURE;
23         }
24         if (fgetc(f1) != fgetc(f2)) {
25             return EXIT_FAILURE;
26         }
27     }
28 }