Fix invocation of readnum()

readnum() takes a boolean for error.
This commit is contained in:
H. Peter Anvin 2007-10-18 18:14:26 -07:00
parent 192d5b5e9c
commit 684f98b636
2 changed files with 12 additions and 12 deletions

View File

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

View File

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