diff options
author | Tim Schumacher <timschumi@gmx.de> | 2021-10-21 23:45:10 +0200 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2021-10-21 23:47:20 -0700 |
commit | e61860243329c57811aec28ed2eb0ff8c8af760f (patch) | |
tree | c33195ebc4597c218098444f85e9cab76b9b870d /Userland | |
parent | 259ef765043caff5bbc1234c7b97270526bbb452 (diff) | |
download | serenity-e61860243329c57811aec28ed2eb0ff8c8af760f.zip |
LibC: Implement mbrlen
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibC/wchar.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Userland/Libraries/LibC/wchar.cpp b/Userland/Libraries/LibC/wchar.cpp index b408e4fb71..d42c15cbf0 100644 --- a/Userland/Libraries/LibC/wchar.cpp +++ b/Userland/Libraries/LibC/wchar.cpp @@ -300,10 +300,14 @@ size_t mbrtowc(wchar_t* pwc, const char* s, size_t n, mbstate_t* state) return consumed_bytes; } -size_t mbrlen(const char*, size_t, mbstate_t*) +size_t mbrlen(const char* s, size_t n, mbstate_t* ps) { - dbgln("FIXME: Implement mbrlen()"); - TODO(); + static mbstate_t anonymous_state = {}; + + if (ps == nullptr) + ps = &anonymous_state; + + return mbrtowc(nullptr, s, n, ps); } size_t wcrtomb(char* s, wchar_t wc, mbstate_t*) |