deweller / switchaudio-osx

Change the audio source for Mac OS X from the command line.
Other
1.16k stars 88 forks source link

Crash when using -t option #21

Closed zulusw closed 4 years ago

zulusw commented 4 years ago

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
zulusw commented 4 years ago

Fix works (tested on Mojave)

deweller commented 4 years ago

Thanks for the report.