aboutsummaryrefslogtreecommitdiff
path: root/lib/memset.c
blob: 670e4b6dffbb844a69fa3e4a13c87f727bd8ae19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/**
 * The memset() function fills the first n bytes of the memory area pointed to by s with the constant byte c.
 * @param s
 * @param c
 * @param n
 * @return
 */
void *
memset(void *s, int c, long unsigned n)
{
  char *pDest = (char *)s;
  for (unsigned i = 0; i < n; ++i) pDest[i] = c;
  return s;
}