]> pd.if.org Git - pdclib/blobdiff - functions/string/memset.c
Initial checkin.
[pdclib] / functions / string / memset.c
diff --git a/functions/string/memset.c b/functions/string/memset.c
new file mode 100644 (file)
index 0000000..2b50b88
--- /dev/null
@@ -0,0 +1,23 @@
+/* $Id$ */
+
+/* Release $Name$ */
+
+/* memset( void *, int, size_t )
+
+   This file is part of the Public Domain C Library (PDCLib).
+   Permission is granted to use, modify, and / or redistribute at will.
+*/
+
+#include <string.h>
+
+void * memset( void * s, int c, size_t n )
+{
+    unsigned char * p = (unsigned char *) s;
+    while ( n-- )
+    {
+        *p++ = (unsigned char) c;
+    }
+    return s;
+}
+
+#warning Test driver missing.