From dc53e35a6055aa983589a818cea94e41d8e7e3d8 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Sat, 29 Sep 2018 21:18:30 -0400 Subject: [PATCH] Fix mid2agb argument parsing --- tools/mid2agb/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/mid2agb/main.cpp b/tools/mid2agb/main.cpp index ece8e25565..ea2b294ac8 100644 --- a/tools/mid2agb/main.cpp +++ b/tools/mid2agb/main.cpp @@ -138,7 +138,7 @@ int main(int argc, char** argv) if (option[0] == '-' && option[1] != '\0') { - const char *arg = GetArgument(argc, argv, i); + const char *arg; switch (std::toupper(option[1])) { @@ -146,11 +146,13 @@ int main(int argc, char** argv) g_exactGateTime = true; break; case 'G': + arg = GetArgument(argc, argv, i); if (arg == nullptr) PrintUsage(); g_voiceGroup = std::stoi(arg); break; case 'L': + arg = GetArgument(argc, argv, i); if (arg == nullptr) PrintUsage(); g_asmLabel = arg; @@ -159,16 +161,19 @@ int main(int argc, char** argv) g_compressionEnabled = false; break; case 'P': + arg = GetArgument(argc, argv, i); if (arg == nullptr) PrintUsage(); g_priority = std::stoi(arg); break; case 'R': + arg = GetArgument(argc, argv, i); if (arg == nullptr) PrintUsage(); g_reverb = std::stoi(arg); break; case 'V': + arg = GetArgument(argc, argv, i); if (arg == nullptr) PrintUsage(); g_masterVolume = std::stoi(arg);