aboutsummaryrefslogtreecommitdiff
path: root/lib/memset.c
blob: 442a305c9216a11ff6fc97dfb4e858023387a9a5 (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, char c, unsigned n)
{
  char *pDest = (char *)s;
  for (unsigned i = 0; i < n; ++i) pDest[i] = c;
  return s;
}