From aec5da467e448af615371329e3fdafd6b41840f8 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 25 Mar 1999 21:42:52 +0000 Subject: Patch from Rosimildo DaSilva : Problem: Sometimes the output file "FOO.BT" is smaller that the second image. Solution: Opening files, input/output, in "binary mode". --- c/src/lib/libbsp/i386/pc386/tools/bin2boot.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'c/src/lib/libbsp/i386/pc386/tools') diff --git a/c/src/lib/libbsp/i386/pc386/tools/bin2boot.c b/c/src/lib/libbsp/i386/pc386/tools/bin2boot.c index a47ca2cee3..170452c232 100644 --- a/c/src/lib/libbsp/i386/pc386/tools/bin2boot.c +++ b/c/src/lib/libbsp/i386/pc386/tools/bin2boot.c @@ -69,7 +69,7 @@ int main(int argc, char* argv[]) } ofile = argv[optind]; - ofp = fopen(ofile, "w"); + ofp = fopen(ofile, "wb"); if(ofp == NULL) { fprintf(stderr, "unable to open file %s\n", ofile); @@ -105,7 +105,7 @@ int main(int argc, char* argv[]) /* Copy the first image */ optind++; ifile = argv[optind]; - ifp = fopen(ifile,"r"); + ifp = fopen(ifile,"rb"); if(ifp == NULL) { fprintf(stderr, "unable to open output file %s\n", ifile); @@ -212,7 +212,7 @@ int main(int argc, char* argv[]) /* Copy Second Image */ optind++; ifile = argv[optind]; - ifp = fopen(ifile,"r"); + ifp = fopen(ifile,"rb"); if(ifp == NULL) { fprintf(stderr, "unable to open output file %s\n", ifile); -- cgit v1.2.3