From 2fa2594e43d7ac90f3fa26149ad3de3dbdd9d160 Mon Sep 17 00:00:00 2001 From: lly Date: Mon, 22 Nov 2010 22:46:49 -0500 Subject: [PATCH] toolchain: uClibc: mbrtowc(): set output to NULL in case of empty input string like glibc does Ref: https://bugs.busybox.net/show_bug.cgi?id=1471 --- .../uClibc/patches/0.9.30.1/601-wchar-intlassert.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 toolchain/toolchain/uClibc/patches/0.9.30.1/601-wchar-intlassert.patch diff --git a/toolchain/toolchain/uClibc/patches/0.9.30.1/601-wchar-intlassert.patch b/toolchain/toolchain/uClibc/patches/0.9.30.1/601-wchar-intlassert.patch new file mode 100644 index 0000000000..8302018b17 --- /dev/null +++ b/toolchain/toolchain/uClibc/patches/0.9.30.1/601-wchar-intlassert.patch @@ -0,0 +1,15 @@ +mbrtowc: set output to NULL in case of empty input string like glibc does. + + https://bugs.busybox.net/show_bug.cgi?id=1471 + +--- a/libc/misc/wchar/wchar.c 2008-12-02 20:15:35.000000000 +0300 ++++ b/libc/misc/wchar/wchar.c 2010-11-22 20:23:52.000000000 +0300 +@@ -295,6 +295,8 @@ size_t mbrtowc(wchar_t *__restrict pwc, + n = 1; + } else if (*s == '\0') { + /* According to the ISO C 89 standard this is the expected behaviour. */ ++ if (pwc) ++ *pwc = 0; + return 0; + } else if (!n) { + /* TODO: change error code? */ -- 2.11.4.GIT