deweller/switchaudio-osx

Crash when using -t option

zulusw opened this issue · 2 comments

Missing a colon in the getopt() call:

diff --git a/audio_switch.c b/audio_switch.c
index f45eab7..b3c8c48 100644
--- a/audio_switch.c
+++ b/audio_switch.c
@@ -48,7 +48,7 @@ int runAudioSwitch(int argc, const char * argv[]) {
        int function = 0;
 
        int c;
-       while ((c = getopt(argc, (char **)argv, "hacntf:s:")) != -1) {
+       while ((c = getopt(argc, (char **)argv, "hacnt:f:s:")) != -1) {
                switch (c) {
                        case 'f':
                                // format

Fix works (tested on Mojave)

Thanks for the report.