jedParser: fix return value when something is wrong
This commit is contained in:
parent
a4e489467e
commit
9d8c528c35
|
|
@ -194,7 +194,7 @@ int JedParser::parse()
|
||||||
std::getline(_fd, content, '\n');
|
std::getline(_fd, content, '\n');
|
||||||
if (content[0] != 0x02) {
|
if (content[0] != 0x02) {
|
||||||
printf("wrong file\n");
|
printf("wrong file\n");
|
||||||
return 0;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* read full content
|
/* read full content
|
||||||
|
|
@ -286,7 +286,7 @@ int JedParser::parse()
|
||||||
printf("theorical checksum %x -> %x\n", _checksum, checksum);
|
printf("theorical checksum %x -> %x\n", _checksum, checksum);
|
||||||
if (_checksum != checksum) {
|
if (_checksum != checksum) {
|
||||||
cerr << "Error: wrong checksum" << endl;
|
cerr << "Error: wrong checksum" << endl;
|
||||||
return 0;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_verbose)
|
if (_verbose)
|
||||||
|
|
@ -294,9 +294,8 @@ int JedParser::parse()
|
||||||
|
|
||||||
if (_fuse_count != size) {
|
if (_fuse_count != size) {
|
||||||
cerr << "Not all fuses are programmed" << endl;
|
cerr << "Not all fuses are programmed" << endl;
|
||||||
return 0;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue