summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Libraries/LibC/stdlib.cpp8
-rw-r--r--Userland/Libraries/LibC/stdlib.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Libraries/LibC/stdlib.cpp b/Userland/Libraries/LibC/stdlib.cpp
index 8c2e5545d5..feae781848 100644
--- a/Userland/Libraries/LibC/stdlib.cpp
+++ b/Userland/Libraries/LibC/stdlib.cpp
@@ -865,6 +865,14 @@ lldiv_t lldiv(long long numerator, long long denominator)
return result;
}
+int mblen(char const* s, size_t n)
+{
+ // FIXME: Implement locale support
+ if (!s)
+ return 0;
+ return (MB_CUR_MAX > n) ? n : MB_CUR_MAX;
+}
+
size_t mbstowcs(wchar_t*, const char*, size_t)
{
dbgln("FIXME: Implement mbstowcs()");
diff --git a/Userland/Libraries/LibC/stdlib.h b/Userland/Libraries/LibC/stdlib.h
index c9eae34db1..5a5f63beb4 100644
--- a/Userland/Libraries/LibC/stdlib.h
+++ b/Userland/Libraries/LibC/stdlib.h
@@ -59,6 +59,7 @@ char* mktemp(char*);
int mkstemp(char*);
char* mkdtemp(char*);
void* bsearch(const void* key, const void* base, size_t nmemb, size_t size, int (*compar)(const void*, const void*));
+int mblen(char const*, size_t);
size_t mbstowcs(wchar_t*, const char*, size_t);
int mbtowc(wchar_t*, const char*, size_t);
int wctomb(char*, wchar_t);