diff --git a/flips.cpp b/flips.cpp index e16c575..6e82fee 100644 --- a/flips.cpp +++ b/flips.cpp @@ -280,7 +280,7 @@ const struct errorinfo bpserrors[]={ { el_notthis, "That's the output file already." },//bps_to_output { el_notthis, "This patch is not intended for this ROM." },//bps_not_this { el_broken, "This patch is broken and can't be used." },//bps_broken - { el_broken, "Couldn't read input patch. What exactly are you doing?" },//bps_io + { el_broken, "Couldn't read input patch." },//bps_io { el_warning, "The files are identical! The patch will do nothing." },//bps_identical { el_broken, "These files are too big for this program to handle." },//bps_too_big @@ -790,7 +790,8 @@ struct errorinfo ApplyPatchMem2(file* patch, struct mem inrom, bool verifyinput, if (patchtype==ty_bps) { errinf=bpserrors[bps_apply(patchmem, inrom, &outrom, &manifest, !verifyinput)]; - if (errinf.level==el_notthis && !verifyinput && outrom.ptr) errinf.level=el_warning; + if (errinf.level==el_notthis && !verifyinput && outrom.ptr) + errinf = error(el_warning, "This patch is not intended for this ROM (output created anyways)"); if (errinf.level==el_notthis) { bpsinfo inf = bps_get_info(patch, false); @@ -863,13 +864,13 @@ struct errorinfo ApplyPatchMem2(file* patch, struct mem inrom, bool verifyinput, { if (!WriteWholeFileWithHeader(outromname, inrom, outrom)) { - errinf=error(el_broken, "Couldn't write ROM. Are you on a read-only medium?"); + errinf=error(el_broken, "Couldn't write ROM"); } } } else if (errinf.levelget(), verifyinput, shouldRemoveHeader(inromname, inrom->len()), outromname, manifestinfo); @@ -919,7 +920,7 @@ struct errorinfo ApplyPatch(LPCWSTR patchname, LPCWSTR inromname, bool verifyinp file* patch = file::create(patchname); if (!patch) { - return error(el_broken, "Couldn't read input patch. What exactly are you doing?"); + return error(el_broken, "Couldn't read input patch"); } struct errorinfo errinf=ApplyPatchMem(patch, inromname, verifyinput, outromname, manifestinfo, update_rom_list); delete patch; @@ -1075,13 +1076,13 @@ struct errorinfo CreatePatch(LPCWSTR inromname, LPCWSTR outromname, enum patchty if (errinf.level= el_notthis ? EXIT_FAILURE : EXIT_SUCCESS); +} int flipsmain(int argc, WCHAR * argv[]) { enum patchtype patchtype=ty_null; @@ -1363,7 +1368,7 @@ int flipsmain(int argc, WCHAR * argv[]) struct errorinfo errinf=ApplyPatch(arg[0], arg[1], !ignoreChecksum, outname, &manifestinfo, false); free(outname_buf); puts(errinf.description); - return errinf.level; + return error_to_exit(errinf.level); } case a_create: { @@ -1374,7 +1379,7 @@ int flipsmain(int argc, WCHAR * argv[]) if (patchtype==ty_null) { puts("Error: Unknown patch type."); - return el_broken; + return error_to_exit(el_broken); } LPWSTR arg2=(WCHAR*)malloc(sizeof(WCHAR)*(wcslen(arg[1])+4+1)); arg[2]=arg2; @@ -1397,17 +1402,17 @@ int flipsmain(int argc, WCHAR * argv[]) else { wprintf(TEXT("Error: Unknown patch type (%s)\n"), patchext); - return el_broken; + return error_to_exit(el_broken); } } struct errorinfo errinf=CreatePatch(arg[0], arg[1], patchtype, &manifestinfo, arg[2]); puts(errinf.description); - return errinf.level; + return error_to_exit(errinf.level); } case a_info: { if (numargs!=1) usage(); - return patchinfo(arg[0], &manifestinfo); + return error_to_exit(patchinfo(arg[0], &manifestinfo)); } } return 99;//doesn't happen