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