add all missing wchar functions except floating point parsers
[musl] / src / string / wcsnlen.c
diff --git a/src/string/wcsnlen.c b/src/string/wcsnlen.c
new file mode 100644 (file)
index 0000000..a776337
--- /dev/null
@@ -0,0 +1,8 @@
+#include <wchar.h>
+
+size_t wcsnlen(const wchar_t *s, size_t n)
+{
+       const wchar_t *z = wmemchr(s, 0, n);
+       if (z) n = z-s;
+       return n;
+}