Commit | Line | Data |
---|---|---|
1d4440ea KB |
1 | /*- |
2 | * Copyright (c) 1990 The Regents of the University of California. | |
317e5946 KB |
3 | * All rights reserved. |
4 | * | |
1d4440ea KB |
5 | * This code is derived from software contributed to Berkeley by |
6 | * Chris Torek. | |
7 | * | |
8 | * %sccs.include.redist.c% | |
63f04cd8 RE |
9 | */ |
10 | ||
2ce81398 | 11 | #if defined(LIBC_SCCS) && !defined(lint) |
a64329b4 | 12 | static char sccsid[] = "@(#)memset.c 5.6 (Berkeley) %G%"; |
317e5946 | 13 | #endif /* LIBC_SCCS and not lint */ |
63f04cd8 | 14 | |
a64329b4 | 15 | #include <sys/cdefs.h> |
1d4440ea | 16 | #include <string.h> |
1d4440ea KB |
17 | |
18 | void * | |
19 | memset(dst, c, n) | |
20 | void *dst; | |
21 | register int c; | |
22 | register size_t n; | |
63f04cd8 | 23 | { |
63f04cd8 | 24 | |
1d4440ea KB |
25 | if (n != 0) { |
26 | register char *d = dst; | |
63f04cd8 | 27 | |
1d4440ea KB |
28 | do |
29 | *d++ = c; | |
30 | while (--n != 0); | |
31 | } | |
32 | return (dst); | |
63f04cd8 | 33 | } |