mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-11-21 03:14:19 +08:00
Fix invocation of readnum()
readnum() takes a boolean for error.
This commit is contained in:
parent
192d5b5e9c
commit
684f98b636
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user