From 6436b371af2b52a7b60a5b4f304d1aca2f9f60b3 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 26 May 2012 18:02:45 -0400 Subject: [PATCH] fix failure of mbsinit(0) (not UB; required to return nonzero) issue reported by Richard Pennington; slightly simpler fix applied --- src/multibyte/mbsinit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.25.1