summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-05-26 18:02:45 -0400
committerRich Felker <dalias@aerifal.cx>2012-05-26 18:02:45 -0400
commit6436b371af2b52a7b60a5b4f304d1aca2f9f60b3 (patch)
treee336580ea7f51a57ddcde46121d2b49c31fbc754
parentaefd0f69bd22b825a6196e65b40a02e79fec23b5 (diff)
downloadmusl-6436b371af2b52a7b60a5b4f304d1aca2f9f60b3.tar.gz
musl-6436b371af2b52a7b60a5b4f304d1aca2f9f60b3.tar.bz2
musl-6436b371af2b52a7b60a5b4f304d1aca2f9f60b3.tar.xz
musl-6436b371af2b52a7b60a5b4f304d1aca2f9f60b3.zip
fix failure of mbsinit(0) (not UB; required to return nonzero)
issue reported by Richard Pennington; slightly simpler fix applied
-rw-r--r--src/multibyte/mbsinit.c2
1 files changed, 1 insertions, 1 deletions
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;
}