From 3336c382fbc86aa8a5cbe7572fd92e44a962b18d Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Sun, 10 Oct 2021 22:28:56 +0200 Subject: [PATCH] LibC: Implement wctob --- Userland/Libraries/LibC/wchar.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibC/wchar.cpp b/Userland/Libraries/LibC/wchar.cpp index dd7ca983cf..d12d224e90 100644 --- a/Userland/Libraries/LibC/wchar.cpp +++ b/Userland/Libraries/LibC/wchar.cpp @@ -319,10 +319,12 @@ int wcscoll(const wchar_t* ws1, const wchar_t* ws2) return wcscmp(ws1, ws2); } -int wctob(wint_t) +int wctob(wint_t c) { - dbgln("FIXME: Implement wctob()"); - TODO(); + if (c > 0x7f) + return EOF; + + return static_cast(c); } int mbsinit(const mbstate_t* state)