ref: 788bc6b0f013195bdfd502955b0b8accb965d949
parent: 5449f10ad59bc28d4c35847cfc2415bbea402b85
author: Tevo <estevan.cps@gmail.com>
date: Sat Jan 16 22:03:22 EST 2021
Fix broken argument handling
--- a/main.c
+++ b/main.c
@@ -15,16 +15,12 @@
int
fmtarg(char *fmt)
{
- static char *fmts[] =
- {
- [WAVE] = "wave",
- [FLAC] = "flac",
- [BINARY] = "pcm",
- };
-
- for(int c = 0; c < sizeof(fmts); c++)
- if(cistrcmp(fmt, fmts[c]) == 0)
- return c;
+ if(cistrcmp(fmt, "wave") == 0)
+ return WAVE;
+ if(cistrcmp(fmt, "flac") == 0)
+ return FLAC;
+ if(cistrcmp(fmt, "pcm") == 0)
+ return BINARY;
return UNKNOWN;
}