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