diff --git a/neotools/autoextract.sh b/neotools/autoextract.sh index 7aab24f..c82b84a 100755 --- a/neotools/autoextract.sh +++ b/neotools/autoextract.sh @@ -1,4 +1,5 @@ #!/bin/sh +set -e FILE="$1" NAME="$(basename "$FILE")" @@ -6,7 +7,7 @@ WAVDIR="${NAME%%.*}" if [ "${NAME##*.}" = "vgz" ]; then cp "$FILE" "temp.vgm.gz" - gzip -d "temp.vgm.gz" + gzip -fd "temp.vgm.gz" FILE="temp.vgm" fi diff --git a/neotools/neoadpcmextract.cpp b/neotools/neoadpcmextract.cpp index c635b36..240bef4 100644 --- a/neotools/neoadpcmextract.cpp +++ b/neotools/neoadpcmextract.cpp @@ -55,20 +55,19 @@ void DumpBytes(std::string a_path, const std::vector& a_bytes) int main(int argc, char** argv) { if (argc != 2) - return -1; + return 1; // Open file. FILE* file = fopen(argv[1], "rb"); if (!file) - return -1; + return 1; // Search for pcm headers. std::vector smpBytes; int smpaCount = 0, smpbCount = 0; while (!feof(file) && !ferror(file)) { - if (fgetc(file) != 0x67 && - fgetc(file) != 0x66) + if (fgetc(file) != 0x67 || fgetc(file) != 0x66) continue; uint8_t byte = fgetc(file);