summaryrefslogtreecommitdiffstatshomepage
path: root/src/tools
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2012-02-20 15:59:09 +0000
committer Aaron Giles <aaron@aarongiles.com>2012-02-20 15:59:09 +0000
commit721e1726ee8e04656399db496b6563ffaa51de8b (patch)
tree771c5c8c0e1e0b71b825c50011c9bb9f1a08b17f /src/tools
parent3fc1d53b26e82dbf4a990252579e2bd0bc9d366b (diff)
Better fix is to just not parse start/end when there's no input file.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/chdman.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/tools/chdman.c b/src/tools/chdman.c
index 20b53fd1cc4..43c8f4b1dec 100644
--- a/src/tools/chdman.c
+++ b/src/tools/chdman.c
@@ -963,7 +963,7 @@ static void parse_input_start_end(const parameters_t &params, UINT64 logical_siz
input_start = parse_number(*input_start_hunk_str) * hunkbytes;
if (input_start_frame_str != NULL)
input_start = parse_number(*input_start_frame_str) * framebytes;
- if (input_start > input_end)
+ if (input_start >= input_end)
report_error(1, "Input start offset greater than input file size");
// process input length
@@ -1611,9 +1611,10 @@ static void do_create_hd(parameters_t &params)
parse_hunk_size(params, sector_size, hunk_size);
// process input start/end (needs to know hunk_size)
- UINT64 input_start;
- UINT64 input_end;
- parse_input_start_end(params, input_file ? core_fsize(input_file) : 0, hunk_size, hunk_size, input_start, input_end);
+ UINT64 input_start = 0;
+ UINT64 input_end = 0;
+ if (input_file != NULL)
+ parse_input_start_end(params, core_fsize(input_file), hunk_size, hunk_size, input_start, input_end);
// process compression
chd_codec_type compression[4];