From: Mike Brady Date: Sat, 29 Jul 2017 15:20:58 +0000 (+0200) Subject: make sndio formats case-insensitive, fix a little error message X-Git-Tag: 3.1~10^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a180706987c9392934c251b1bf5509efc6f7dcf;p=thirdparty%2Fshairport-sync.git make sndio formats case-insensitive, fix a little error message --- diff --git a/audio_sndio.c b/audio_sndio.c index 92f73bed..e7fd787b 100644 --- a/audio_sndio.c +++ b/audio_sndio.c @@ -136,15 +136,15 @@ static int init(int argc, char **argv) { } if (config_lookup_string(config.cfg, "sndio.format", &tmp)) { for (i = 0, found = 0; i < sizeof(formats) / sizeof(formats[0]); i++) { - if (strcmp(formats[i].name, tmp) == 0) { + if (strcasecmp(formats[i].name, tmp) == 0) { config.output_format = formats[i].fmt; found = 1; break; } } if (!found) - die("Invalid output format \"%s\". Should be one of: s8, u8, s16, s24, " - "s24le3, s24be3, s32", + die("Invalid output format \"%s\". Should be one of: S8, U8, S16, S24, " + "S24_3LE, S24_3BE, S32", tmp); } }