Add missing checks to oxfstool

This commit is contained in:
Gary Talent 2018-03-09 21:44:41 -06:00
parent 16e0fddaca
commit a2cf756f4a

View File

@ -248,9 +248,6 @@ int compact(int argc, char **args) {
if (fs) {
fs->resize();
} else {
fprintf(stderr, "Invalid file system.\n");
}
// write back to file
auto fsFile = fopen(fsPath, "wb");
@ -265,6 +262,9 @@ int compact(int argc, char **args) {
}
delete fs;
} else {
fprintf(stderr, "Invalid file system.\n");
}
delete []fsBuff;
} else {
fprintf(stderr, "Could not open file: %s\n", fsPath);
@ -321,6 +321,7 @@ int remove(int argc, char **args) {
int walk(int argc, char **args) {
int err = 0;
size_t fsSize;
if (argc >= 2) {
auto fsPath = args[2];
auto fsBuff = loadFileBuff(fsPath, &fsSize);
if (fsBuff) {
@ -350,6 +351,7 @@ int walk(int argc, char **args) {
} else {
err = 2;
}
}
return err;
}