diff options
Diffstat (limited to 'src/lib/libc/string/memset.c')
| -rw-r--r-- | src/lib/libc/string/memset.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/src/lib/libc/string/memset.c b/src/lib/libc/string/memset.c index 117de2e80b..61709c139d 100644 --- a/src/lib/libc/string/memset.c +++ b/src/lib/libc/string/memset.c | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | /* $OpenBSD: memset.c,v 1.6 2008/03/15 21:40:39 ray Exp $ */ | ||
| 1 | /*- | 2 | /*- |
| 2 | * Copyright (c) 1990 The Regents of the University of California. | 3 | * Copyright (c) 1990 The Regents of the University of California. |
| 3 | * All rights reserved. | 4 | * All rights reserved. |
| @@ -13,11 +14,7 @@ | |||
| 13 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
| 14 | * notice, this list of conditions and the following disclaimer in the | 15 | * notice, this list of conditions and the following disclaimer in the |
| 15 | * documentation and/or other materials provided with the distribution. | 16 | * documentation and/or other materials provided with the distribution. |
| 16 | * 3. All advertising materials mentioning features or use of this software | 17 | * 3. Neither the name of the University nor the names of its contributors |
| 17 | * must display the following acknowledgement: | ||
| 18 | * This product includes software developed by the University of | ||
| 19 | * California, Berkeley and its contributors. | ||
| 20 | * 4. Neither the name of the University nor the names of its contributors | ||
| 21 | * may be used to endorse or promote products derived from this software | 18 | * may be used to endorse or promote products derived from this software |
| 22 | * without specific prior written permission. | 19 | * without specific prior written permission. |
| 23 | * | 20 | * |
| @@ -34,25 +31,16 @@ | |||
| 34 | * SUCH DAMAGE. | 31 | * SUCH DAMAGE. |
| 35 | */ | 32 | */ |
| 36 | 33 | ||
| 37 | #if defined(LIBC_SCCS) && !defined(lint) | ||
| 38 | /*static char *sccsid = "from: @(#)memset.c 5.6 (Berkeley) 1/26/91";*/ | ||
| 39 | static char *rcsid = "$Id: memset.c,v 1.1.1.1 1995/10/18 08:42:21 deraadt Exp $"; | ||
| 40 | #endif /* LIBC_SCCS and not lint */ | ||
| 41 | |||
| 42 | #include <string.h> | 34 | #include <string.h> |
| 43 | 35 | ||
| 44 | void * | 36 | void * |
| 45 | memset(dst, c, n) | 37 | memset(void *dst, int c, size_t n) |
| 46 | void *dst; | ||
| 47 | register int c; | ||
| 48 | register size_t n; | ||
| 49 | { | 38 | { |
| 50 | |||
| 51 | if (n != 0) { | 39 | if (n != 0) { |
| 52 | register char *d = dst; | 40 | unsigned char *d = dst; |
| 53 | 41 | ||
| 54 | do | 42 | do |
| 55 | *d++ = c; | 43 | *d++ = (unsigned char)c; |
| 56 | while (--n != 0); | 44 | while (--n != 0); |
| 57 | } | 45 | } |
| 58 | return (dst); | 46 | return (dst); |
