Module Name: src Committed By: lukem Date: Sat Apr 11 07:36:43 UTC 2009
Modified Files: src/sbin/mount_portal: activate.c pt_tcp.c Log Message: fix sign-compare issues To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sbin/mount_portal/activate.c cvs rdiff -u -r1.20 -r1.21 src/sbin/mount_portal/pt_tcp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sbin/mount_portal/activate.c diff -u src/sbin/mount_portal/activate.c:1.14 src/sbin/mount_portal/activate.c:1.15 --- src/sbin/mount_portal/activate.c:1.14 Mon Jul 2 18:07:44 2007 +++ src/sbin/mount_portal/activate.c Sat Apr 11 07:36:43 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: activate.c,v 1.14 2007/07/02 18:07:44 pooka Exp $ */ +/* $NetBSD: activate.c,v 1.15 2009/04/11 07:36:43 lukem Exp $ */ /* * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: activate.c,v 1.14 2007/07/02 18:07:44 pooka Exp $"); +__RCSID("$NetBSD: activate.c,v 1.15 2009/04/11 07:36:43 lukem Exp $"); #endif /* not lint */ #include <stdio.h> @@ -55,7 +55,7 @@ #include "portald.h" -static int get_request(int, struct portal_cred *, char *, int); +static int get_request(int, struct portal_cred *, char *, size_t); static void send_reply(int, int, int); /* @@ -75,11 +75,11 @@ } static int -get_request(int so, struct portal_cred *pcr, char *key, int klen) +get_request(int so, struct portal_cred *pcr, char *key, size_t klen) { struct iovec iov[2]; struct msghdr msg; - int n; + ssize_t n; iov[0].iov_base = (caddr_t) pcr; iov[0].iov_len = sizeof(*pcr); @@ -94,7 +94,7 @@ if (n < 0) return (errno); - if (n <= sizeof(*pcr)) + if (n <= (ssize_t)sizeof(*pcr)) return (EINVAL); n -= sizeof(*pcr); Index: src/sbin/mount_portal/pt_tcp.c diff -u src/sbin/mount_portal/pt_tcp.c:1.20 src/sbin/mount_portal/pt_tcp.c:1.21 --- src/sbin/mount_portal/pt_tcp.c:1.20 Mon Jul 2 18:07:45 2007 +++ src/sbin/mount_portal/pt_tcp.c Sat Apr 11 07:36:43 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pt_tcp.c,v 1.20 2007/07/02 18:07:45 pooka Exp $ */ +/* $NetBSD: pt_tcp.c,v 1.21 2009/04/11 07:36:43 lukem Exp $ */ /* * Copyright (c) 1992, 1993, 1994 @@ -37,7 +37,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: pt_tcp.c,v 1.20 2007/07/02 18:07:45 pooka Exp $"); +__RCSID("$NetBSD: pt_tcp.c,v 1.21 2009/04/11 07:36:43 lukem Exp $"); #endif /* not lint */ #include <stdio.h> @@ -75,7 +75,7 @@ const char *cause = "unknown"; q = strchr(p, '/'); - if (q == 0 || q - p >= sizeof(host)) + if (q == 0 || (size_t)(q - p) >= sizeof(host)) return (EINVAL); *q = '\0'; if (strlcpy(host, p, sizeof(host)) >= sizeof(host))