Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
s = empty_string;
n = 1;
} else if (*s == '\0') {
+ if (pwc)
+ *pwc = '\0';
/* According to the ISO C 89 standard this is the expected behaviour. */
return 0;
} else if (!n) {
locale-mbwc/tst_wctrans
locale-mbwc/tst_wctype
locale-mbwc/tst_wcwidth
+locale-mbwc/tst2_mbrtowc
locale/show-ucs-data
locale/tst-digits
locale/tst-langinfo
tst_wcspbrk tst_wcsrtombs tst_wcsspn tst_wcsstr \
tst_wcstod tst_wcstok tst_wcstombs tst_wcswidth \
tst_wcsxfrm tst_wctob tst_wctomb tst_wctrans \
- tst_wctype tst_wcwidth tst_strfmon
-
+ tst_wctype tst_wcwidth tst_strfmon \
+ tst2_mbrtowc
# NOTE: For now disabled tst_strfmon to avoid build failure.
TESTS_DISABLED := tst_strfmon
--- /dev/null
+#include <wchar.h>
+#include <assert.h>
+#include <stdlib.h>
+
+/* bugs.uclibc.org/1471 : make sure output is 0 */
+static int
+do_test(void)
+{
+ wchar_t output;
+ int result;
+
+ output = L'A'; /* anything other than 0 will do... */
+ result = mbrtowc (&output, "", 1, 0);
+
+ assert (result == 0);
+ assert (output == 0);
+
+ return EXIT_SUCCESS;
+}
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"