From 6c49129750fc2d8778d30f623b0a1ea22fa79328 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Mon, 22 Dec 2025 20:01:45 -0500 Subject: usr: sdk: Add memset() function Signed-off-by: Ian Moffett --- usr/sdk/common/string/memset.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 usr/sdk/common/string/memset.c (limited to 'usr/sdk/common/string/memset.c') diff --git a/usr/sdk/common/string/memset.c b/usr/sdk/common/string/memset.c new file mode 100644 index 0000000..ac0b4a2 --- /dev/null +++ b/usr/sdk/common/string/memset.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2025, Ian Moffett. + * Provided under the BSD-3 clause. + */ + +#include + +void * +memset(void *s, int c, USIZE n) +{ + if (s == NULL) { + return NULL; + } + + for (USIZE i = 0; i < n; ++i) { + ((BYTE *)s)[i] = c; + } + + return s; +} -- cgit v1.2.3