include: add {en,dis}able_io_int_classes() helpers
[hvf.git] / build / padcat.c
blob58855ecc767c8bfe9fa2b8c77ea1eb8a52bfc1fa
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <assert.h>
6 void cat(char *fn)
8 FILE *f;
9 char buf[80];
10 size_t n;
12 f = fopen(fn, "rb");
13 if (!f) {
14 fprintf(stderr, "Could not open file \"%s\".\n",
15 fn);
16 exit(1);
19 do {
20 memset(buf, 0, 80);
21 n = fread(buf, 1, 80, f);
22 if (n)
23 assert(fwrite(buf, 1, 80, stdout) == 80);
24 } while(n == 80);
26 fclose(f);
29 int main(int argc, char **argv)
31 int i;
33 for(i=1; i<argc; i++)
34 cat(argv[i]);
36 return 0;