mpd-show: initialise iconv before using it
commite9de9525dd96884291a65d524d1989943660c128
authorMichal Nazarewicz <mina86@mina86.com>
Tue, 14 Feb 2017 17:44:09 +0000 (14 18:44 +0100)
committerMichal Nazarewicz <mina86@mina86.com>
Tue, 14 Feb 2017 17:44:28 +0000 (14 18:44 +0100)
treea14ff1ba70fbb62fc995afab18bfd58c604566bc
parent55eaf13a14df6b5414927aa75589ddff4ab8833e
mpd-show: initialise iconv before using it

Since parseArguments was called before initCodesets it could not use
iconv for converting multibyte characters into wide characters but
that’s exactly what that function attempted to do with the help of
wideFromMulti function.  Because of this the fall-back code had to
be used instead of using iconv.  Swap the initialisation order so
that iconv is set up first.

Also, fix the fall-back code in wideFromMulti where it incorrectly
handled mbrtowc returning -2.
mpd-show.c