summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibC
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2021-09-22 10:22:24 +0000
committerBrian Gianforcaro <b.gianfo@gmail.com>2021-10-03 05:28:51 +0000
commitfa1208edfd3eff6fac3571a052b6169ef0c27ebf (patch)
tree11fca05898696e316ee1dcf59e5e457c40314f64 /Userland/Libraries/LibC
parent485c0ef691822873df8a6961ec099779ff19412c (diff)
downloadserenity-fa1208edfd3eff6fac3571a052b6169ef0c27ebf.zip
LibC: Implement wmemset
Diffstat (limited to 'Userland/Libraries/LibC')
-rw-r--r--Userland/Libraries/LibC/wchar.cpp9
-rw-r--r--Userland/Libraries/LibC/wchar.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/Userland/Libraries/LibC/wchar.cpp b/Userland/Libraries/LibC/wchar.cpp
index 052ab8b1cc..13208004c2 100644
--- a/Userland/Libraries/LibC/wchar.cpp
+++ b/Userland/Libraries/LibC/wchar.cpp
@@ -393,4 +393,13 @@ wchar_t* wmemcpy(wchar_t* dest, const wchar_t* src, size_t n)
return dest;
}
+
+wchar_t* wmemset(wchar_t* wcs, wchar_t wc, size_t n)
+{
+ for (size_t i = 0; i < n; i++) {
+ wcs[i] = wc;
+ }
+
+ return wcs;
+}
}
diff --git a/Userland/Libraries/LibC/wchar.h b/Userland/Libraries/LibC/wchar.h
index a622906218..7f731ad38b 100644
--- a/Userland/Libraries/LibC/wchar.h
+++ b/Userland/Libraries/LibC/wchar.h
@@ -45,5 +45,6 @@ wchar_t* wcspbrk(const wchar_t*, const wchar_t*);
wchar_t* wcsstr(const wchar_t*, const wchar_t*);
wchar_t* wmemchr(const wchar_t*, wchar_t, size_t);
wchar_t* wmemcpy(wchar_t*, const wchar_t*, size_t);
+wchar_t* wmemset(wchar_t*, wchar_t, size_t);
__END_DECLS