9 void findnulls(int fd, char *source, int squelch)
11 int i, ret, n, s, off;
17 ret = read(fd, buf, sizeof(buf));
25 for(i = 0; i < ret; i++) {
34 printf("%i %i\n", s, n);
36 printf("%s: %i %i\n", source, s, n);
49 printf("%i %i\n", s, n);
51 printf("%s: %i %i\n", source, s, n);
55 int main(int argc, char **argv)
62 while((c = getopt(argc, argv, "hs:")) >= 0) {
65 squelch = atoi(optarg);
71 fprintf(stderr, "usage: findnulls [-h] [-s squelch] [FILE...]\n");
76 for(i = optind; i < argc; i++) {
77 if((fd = open(argv[i], O_RDONLY)) < 0) {
81 findnulls(fd, argv[i], squelch);
85 findnulls(0, NULL, squelch);
92 * compile-command: "gcc -Wall -g -o findnulls findnulls.c"