Full memory management support (memory.c & memory.h & mem.S)
[reactos.git] / freeldr / bootsect / stubit.c
1 #include <stdio.h>
2
3 FILE *in;
4 FILE *in2;
5 FILE *out;
6
7 int main(int argc, char *argv[])
8 {
9 unsigned char ch;
10
11 if (argc < 4)
12 {
13 printf("usage: stubit infile1.bin infile2.sys outfile.bin\n");
14 return -1;
15 }
16
17 if ((in = fopen(argv[1], "rb")) == NULL)
18 {
19 printf("Couldn't open data file.\n");
20 return -1;
21 }
22 if ((in2 = fopen(argv[2], "rb")) == NULL)
23 {
24 printf("Couldn't open data file.\n");
25 return -1;
26 }
27 if ((out = fopen(argv[3], "wb")) == NULL)
28 {
29 printf("Couldn't open output file.\n");
30 return -1;
31 }
32
33 ch = fgetc(in);
34 while (!feof(in))
35 {
36 fputc(ch, out);
37 ch = fgetc(in);
38 }
39
40 ch = fgetc(in2);
41 while (!feof(in2))
42 {
43 fputc(ch, out);
44 ch = fgetc(in2);
45 }
46
47 fclose(in);
48 fclose(in2);
49 fclose(out);
50
51 return 0;
52 }