diff options
author | ray <> | 2008-03-15 21:40:39 +0000 |
---|---|---|
committer | ray <> | 2008-03-15 21:40:39 +0000 |
commit | 345b0c776379664674cd63535337db1453a25b4d (patch) | |
tree | 143bcc1507b8de832470996d1254fa09e5044b3a | |
parent | b89c0dd40131bd782fa134e50e256db35c015e98 (diff) | |
download | openbsd-345b0c776379664674cd63535337db1453a25b4d.tar.gz openbsd-345b0c776379664674cd63535337db1453a25b4d.tar.bz2 openbsd-345b0c776379664674cd63535337db1453a25b4d.zip |
Convert c to unsigned char, like it says in the manual. Also add
cast to make it explicit.
Found by lint, OK millert.
-rw-r--r-- | src/lib/libc/string/memset.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/libc/string/memset.c b/src/lib/libc/string/memset.c index db32866a0e..61709c139d 100644 --- a/src/lib/libc/string/memset.c +++ b/src/lib/libc/string/memset.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: memset.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */ | 1 | /* $OpenBSD: memset.c,v 1.6 2008/03/15 21:40:39 ray Exp $ */ |
2 | /*- | 2 | /*- |
3 | * Copyright (c) 1990 The Regents of the University of California. | 3 | * Copyright (c) 1990 The Regents of the University of California. |
4 | * All rights reserved. | 4 | * All rights reserved. |
@@ -36,12 +36,11 @@ | |||
36 | void * | 36 | void * |
37 | memset(void *dst, int c, size_t n) | 37 | memset(void *dst, int c, size_t n) |
38 | { | 38 | { |
39 | |||
40 | if (n != 0) { | 39 | if (n != 0) { |
41 | char *d = dst; | 40 | unsigned char *d = dst; |
42 | 41 | ||
43 | do | 42 | do |
44 | *d++ = c; | 43 | *d++ = (unsigned char)c; |
45 | while (--n != 0); | 44 | while (--n != 0); |
46 | } | 45 | } |
47 | return (dst); | 46 | return (dst); |