From: Rich Felker Date: Sat, 26 May 2012 22:02:45 +0000 (-0400) Subject: fix failure of mbsinit(0) (not UB; required to return nonzero) X-Git-Tag: v0.9.1~20 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6436b371af2b52a7b60a5b4f304d1aca2f9f60b3;p=oweals%2Fmusl.git fix failure of mbsinit(0) (not UB; required to return nonzero) issue reported by Richard Pennington; slightly simpler fix applied --- diff --git a/src/multibyte/mbsinit.c b/src/multibyte/mbsinit.c index d307e5a7..c0e7e494 100644 --- a/src/multibyte/mbsinit.c +++ b/src/multibyte/mbsinit.c @@ -13,5 +13,5 @@ int mbsinit(const mbstate_t *st) { - return !*(unsigned *)st; + return !st || !*(unsigned *)st; }