From d72bbf4be3ede6735f1f235246e0d19d738bc7a2 Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Sun, 2 Apr 2006 02:10:35 +0000 Subject: [PATCH] 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 --- src/lib/libutil/getmaxpartitions.c | 4 ++-- src/lib/libutil/getrawpartition.c | 4 ++-- src/lib/libutil/passwd.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/libutil/getmaxpartitions.c b/src/lib/libutil/getmaxpartitions.c index d6a5ced3..99cca80a 100644 --- a/src/lib/libutil/getmaxpartitions.c +++ b/src/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/src/lib/libutil/getrawpartition.c b/src/lib/libutil/getrawpartition.c index c94173f9..6543b35b 100644 --- a/src/lib/libutil/getrawpartition.c +++ b/src/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/src/lib/libutil/passwd.c b/src/lib/libutil/passwd.c index b176234d..c3dc4ece 100644 --- a/src/lib/libutil/passwd.c +++ b/src/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);