[hackers] [scc] [libc] Add memset() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Thu, 16 Feb 2017 22:49:19 +0100 (CET)

commit f8fd3858424b64391e582fc7e53f8a63ee113d98
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Thu Feb 16 22:42:42 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu Feb 16 22:42:42 2017 +0100

    [libc] Add memset()

diff --git a/libc/src/Makefile b/libc/src/Makefile
index af1f966..4b0863c 100644
--- a/libc/src/Makefile
+++ b/libc/src/Makefile
_AT_@ -2,7 +2,8 @@
 .POSIX:
 
 LIBCOBJ = assert.o strcpy.o strcmp.o strlen.o strchr.o \
- strrchr.o strcat.o strncpy.o strncat.o
+ strrchr.o strcat.o strncpy.o strncat.o \
+ memset.o
 
 all: libc.a
 
diff --git a/libc/src/memset.c b/libc/src/memset.c
new file mode 100644
index 0000000..2222ce1
--- /dev/null
+++ b/libc/src/memset.c
_AT_@ -0,0 +1,13 @@
+/* See LICENSE file for copyright and license details. */
+
+#include <string.h>
+
+void *
+memset(void *s, int c, size_t n)
+{
+ char *bp;
+
+ for (bp = s; n-- > 0; *bp++ = c)
+ /* nothing */;
+ return s;
+}
Received on Thu Feb 16 2017 - 22:49:19 CET

This archive was generated by hypermail 2.3.0 : Thu Feb 16 2017 - 23:00:18 CET