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.
13 void * memset( void * s, int c, size_t n )
15 unsigned char * p = (unsigned char *) s;
18 *p++ = (unsigned char) c;
24 #include <_PDCLIB_test.h>
28 char s[] = "xxxxxxxxx";
30 TESTCASE( memset( s, 'o', 10 ) == s );
31 TESTCASE( s[9] == 'o' );
32 TESTCASE( memset( s, '_', 0 ) == s );
33 TESTCASE( s[0] == 'o' );
34 TESTCASE( memset( s, '_', 1 ) == s );
35 TESTCASE( s[0] == '_' );
36 TESTCASE( s[1] == 'o' );