diff target-utils/libc/memset.c @ 91:659fa1a26269

target-utils/libc: non-optimized C implementation of memset for the sake of completeness and compliance
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 28 Oct 2016 23:15:01 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/target-utils/libc/memset.c	Fri Oct 28 23:15:01 2016 +0000
@@ -0,0 +1,14 @@
+#include <sys/types.h>
+
+u_char *
+memset(buf, c, n)
+	u_char *buf;
+	int c;
+	unsigned n;
+{
+	u_char *p = buf;
+
+	for (; n; n--)
+		*p++ = c;
+	return buf;
+}