diff options
author | 2006-04-02 02:10:35 +0000 | |
---|---|---|
committer | 2006-04-02 02:10:35 +0000 | |
commit | 6d61a83884e338947b75dad69382a72a6f897ba5 (patch) | |
tree | 6824cd8c41ccb6ed65461d9b1e1d155668e9c89c | |
parent | be more careful checking for (off_t)-1 as the failure condition from (diff) | |
download | wireguard-openbsd-6d61a83884e338947b75dad69382a72a6f897ba5.tar.xz wireguard-openbsd-6d61a83884e338947b75dad69382a72a6f897ba5.zip |
getting to the bottom of the issues. sprinkle a few casts that will
actually help us find bugs later (with lint, not cc), if they get
introduced
-rw-r--r-- | lib/libutil/getmaxpartitions.c | 4 | ||||
-rw-r--r-- | lib/libutil/getrawpartition.c | 4 | ||||
-rw-r--r-- | lib/libutil/passwd.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/libutil/getmaxpartitions.c b/lib/libutil/getmaxpartitions.c index d6a5ced3325..99cca80a75c 100644 --- a/lib/libutil/getmaxpartitions.c +++ b/lib/libutil/getmaxpartitions.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getmaxpartitions.c,v 1.5 2005/08/02 21:46:23 espie Exp $ */ +/* $OpenBSD: getmaxpartitions.c,v 1.6 2006/04/02 02:10:35 deraadt Exp $ */ /* $NetBSD: getmaxpartitions.c,v 1.1 1996/05/16 07:03:31 thorpej Exp $ */ /*- @@ -51,7 +51,7 @@ getmaxpartitions(void) mib[0] = CTL_KERN; mib[1] = KERN_MAXPARTITIONS; varlen = sizeof(maxpart); - if (sysctl(mib, 2, &maxpart, &varlen, NULL, 0) < 0) + if (sysctl(mib, 2, &maxpart, &varlen, NULL, (size_t)0) < 0) return (-1); return (maxpart); diff --git a/lib/libutil/getrawpartition.c b/lib/libutil/getrawpartition.c index c94173f9525..6543b35bd97 100644 --- a/lib/libutil/getrawpartition.c +++ b/lib/libutil/getrawpartition.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getrawpartition.c,v 1.5 2005/08/02 21:46:23 espie Exp $ */ +/* $OpenBSD: getrawpartition.c,v 1.6 2006/04/02 02:10:35 deraadt Exp $ */ /* $NetBSD: getrawpartition.c,v 1.1 1996/05/16 07:03:33 thorpej Exp $ */ /*- @@ -51,7 +51,7 @@ getrawpartition(void) mib[0] = CTL_KERN; mib[1] = KERN_RAWPARTITION; varlen = sizeof(rawpart); - if (sysctl(mib, 2, &rawpart, &varlen, NULL, 0) < 0) + if (sysctl(mib, 2, &rawpart, &varlen, NULL, (size_t)0) < 0) return (-1); return (rawpart); diff --git a/lib/libutil/passwd.c b/lib/libutil/passwd.c index b176234dcf5..c3dc4ece8bf 100644 --- a/lib/libutil/passwd.c +++ b/lib/libutil/passwd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: passwd.c,v 1.46 2005/08/02 21:46:23 espie Exp $ */ +/* $OpenBSD: passwd.c,v 1.47 2006/04/02 02:10:35 deraadt Exp $ */ /* * Copyright (c) 1987, 1993, 1994, 1995 @@ -312,7 +312,7 @@ pw_copy(int ffd, int tfd, const struct passwd *pw, const struct passwd *opw) if (!(to = fdopen(tfd, "w"))) pw_error(pw_lck ? pw_lck : NULL, pw_lck ? 1 : 0, 1); - for (done = 0; fgets(buf, sizeof(buf), from);) { + for (done = 0; fgets(buf, (int)sizeof(buf), from);) { if ((ep = strchr(buf, '\n')) == NULL) { warnx("%s: line too long", master); pw_error(NULL, 0, 1); |