src-filters: Add missing includes, reduce warnings
[h316.git] / pc-tools / src-filters / zstrip.c
1 #include <stdio.h>
2 #include <fcntl.h>
3 #include <sys/types.h>
4 #include <sys/stat.h>
5 #include <stdlib.h>
6 #include <unistd.h>
7
8 #define MAX_SIZE 1000000
9
10 int main(int argc, char ** argv){
11 int fd= open(argv[1], O_RDONLY );
12 if (fd<1) printf("Scheiße!\n");
13 char * buff=(char *) malloc(MAX_SIZE);
14
15 int sp=0;
16 int ep=read (fd, buff, MAX_SIZE)-1;
17 close (fd);
18
19 while(buff[sp]==0) sp++;
20 while(buff[ep]==0) ep--;
21
22 write(1,buff+sp,ep-sp+1);
23
24 }
25