bin2ihex & ihex2bin command-line options

This commit is contained in:
Kimmo Kulovesi
2014-01-03 10:18:03 +02:00
parent 9ed8178678
commit bf8e774eeb
3 changed files with 7 additions and 7 deletions

View File

@@ -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.

View File

@@ -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;

View File

@@ -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;