5 /* memset( void *, int, size_t )
7 This file is part of the Public Domain C Library (PDCLib).
8 Permission is granted to use, modify, and / or redistribute at will.
15 void * memset( void * s, int c, size_t n )
17 unsigned char * p = (unsigned char *) s;
20 *p++ = (unsigned char) c;
28 #include <_PDCLIB_test.h>
32 char s[] = "xxxxxxxxx";
34 TESTCASE( memset( s, 'o', 10 ) == s );
35 TESTCASE( s[9] == 'o' );
36 TESTCASE( memset( s, '_', 0 ) == s );
37 TESTCASE( s[0] == 'o' );
38 TESTCASE( memset( s, '_', 1 ) == s );
39 TESTCASE( s[0] == '_' );
40 TESTCASE( s[1] == 'o' );