From 684f98b6360558eb4a2ddf061378ae0f90584259 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Thu, 18 Oct 2007 18:14:26 -0700 Subject: [PATCH] Fix invocation of readnum() readnum() takes a boolean for error. --- rdoff/rdf2bin.c | 14 +++++++------- rdoff/rdf2ihx.c | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/rdoff/rdf2bin.c b/rdoff/rdf2bin.c index 0b3f999..7140b2b 100644 --- a/rdoff/rdf2bin.c +++ b/rdoff/rdf2bin.c @@ -30,7 +30,7 @@ char *getfilename(char *pathname) int main(int argc, char **argv) { rdfmodule *m; - int tmp; + bool err; FILE *of; char *padding; int codepad, datapad, bsspad = 0; @@ -49,22 +49,22 @@ int main(int argc, char **argv) while (argc > 2) { if (!strcmp(*argv, "-o")) { argv++, argc--; - origin = readnum(*argv, &tmp); - if (tmp) { + origin = readnum(*argv, &err); + if (err) { fprintf(stderr, "rdf2bin: invalid parameter: %s\n", *argv); return 1; } } else if (!strcmp(*argv, "-p")) { argv++, argc--; - align = readnum(*argv, &tmp); - if (tmp) { + align = readnum(*argv, &err); + if (err) { fprintf(stderr, "rdf2bin: invalid parameter: %s\n", *argv); return 1; } } else if (!strcmp(*argv, "-b")) { argv++, argc--; - bsspad = readnum(*argv, &tmp); - if (tmp) { + bsspad = readnum(*argv, &err); + if (err) { fprintf(stderr, "rdf2bin: invalid parameter: %s\n", *argv); return 1; } diff --git a/rdoff/rdf2ihx.c b/rdoff/rdf2ihx.c index 94ba1cb..5e9fba0 100644 --- a/rdoff/rdf2ihx.c +++ b/rdoff/rdf2ihx.c @@ -45,7 +45,7 @@ static int write_data_record(FILE * of, int ofs, int nbytes, int main(int argc, char **argv) { rdfmodule *m; - int tmp; + bool err; FILE *of; char *padding; uint8_t *segbin[2]; @@ -64,15 +64,15 @@ int main(int argc, char **argv) while (argc > 2) { if (strcmp(*argv, "-o") == 0) { argv++, argc--; - origin = readnum(*argv, &tmp); - if (tmp) { + origin = readnum(*argv, &err); + if (err) { fprintf(stderr, "rdf2ihx: invalid parameter: %s\n", *argv); return 1; } } else if (strcmp(*argv, "-p") == 0) { argv++, argc--; - align = readnum(*argv, &tmp); - if (tmp) { + align = readnum(*argv, &err); + if (err) { fprintf(stderr, "rdf2ihx: invalid parameter: %s\n", *argv); return 1; } -- 2.7.4