From 45d991a62f4049e2aa154ae894df4d49f8f7195c Mon Sep 17 00:00:00 2001 From: avolkov Date: Thu, 22 Apr 2004 19:39:34 +0000 Subject: [PATCH] Force IO to binary and seek to frames git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1360 8092fc87-c524-0410-9efc-e669fe64eaf9 --- tools/abx/abx2raw.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/abx/abx2raw.c b/tools/abx/abx2raw.c index c92f4fe25..4159cad87 100644 --- a/tools/abx/abx2raw.c +++ b/tools/abx/abx2raw.c @@ -24,13 +24,13 @@ main(int argc, char *argv[]) { return EXIT_FAILURE; } - in = fopen(argv[1], "r"); + in = fopen(argv[1], "rb"); if (!in) { perror("Could not open input file"); return EXIT_FAILURE; } - out = fopen(argv[2], "w"); + out = fopen(argv[2], "wb"); if (!out) { perror("Could not open output file"); return EXIT_FAILURE; @@ -95,6 +95,7 @@ convert_abx(FILE *in, FILE *out) { uncoded = malloc(sizeof (uint8_t *) * abx.num_frames); for (i = 0; i < abx.num_frames; i++) { frames[i] = malloc(frame_info[i].fsize); + fseek(in, frame_info[i].addr, SEEK_SET); read_data(frames[i], frame_info[i].fsize, in); #if 0