From bf8e774eebe72849b9d6dbc0f2691f7b9ceed6b2 Mon Sep 17 00:00:00 2001 From: Kimmo Kulovesi Date: Fri, 3 Jan 2014 10:18:03 +0200 Subject: [PATCH] bin2ihex & ihex2bin command-line options --- README.md | 6 +++--- bin2ihex.c | 4 ++-- ihex2bin.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c8290e6..53c5d61 100644 --- a/README.md +++ b/README.md @@ -91,11 +91,11 @@ Usage by example: # equal to the address of the first data byte read from input): ihex2bin -A -i infile.hex -o outfile.bin -Both programs also accept the option `-v` to enable some debug messages. +Both programs also accept the option `-v` to increase verbosity. When using `ihex2bin` on Intel HEX files produced by compilers and such, it is a good idea to specify the command-line option `-A` to autodetect the address offset. Otherwise the program will simply fill any unused -addresses, starting from 0, with zero bytes, which may end up being -mega- or even gigabytes. +addresses, starting from 0, with zero bytes, which may total mega- or +even gigabytes. diff --git a/bin2ihex.c b/bin2ihex.c index 2308fd3..c5466e5 100644 --- a/bin2ihex.c +++ b/bin2ihex.c @@ -54,7 +54,7 @@ main (int argc, char *argv[]) { if (++i == argc) { goto invalid_argument; } - if (!(outfile = fopen(++arg, "w"))) { + if (!(outfile = fopen(argv[i], "w"))) { goto argument_error; } break; @@ -62,7 +62,7 @@ main (int argc, char *argv[]) { if (++i == argc) { goto invalid_argument; } - if (!(infile = fopen(++arg, "rb"))) { + if (!(infile = fopen(argv[i], "rb"))) { goto argument_error; } break; diff --git a/ihex2bin.c b/ihex2bin.c index b1393c9..a40bcf9 100644 --- a/ihex2bin.c +++ b/ihex2bin.c @@ -66,7 +66,7 @@ main (int argc, char *argv[]) { if (++i == argc) { goto invalid_argument; } - if (!(outfile = fopen(++arg, "w"))) { + if (!(outfile = fopen(argv[i], "w"))) { goto argument_error; } break; @@ -74,7 +74,7 @@ main (int argc, char *argv[]) { if (++i == argc) { goto invalid_argument; } - if (!(infile = fopen(++arg, "rb"))) { + if (!(infile = fopen(argv[i], "rb"))) { goto argument_error; } break;