summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-09-14 10:37:59 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-09-14 10:37:59 +0000
commita7162cd6abe395805da2514f42bca4d6e1ebe610 (patch)
treeb30ff72fb6cfaf25232a717aa63a4a094d507fba
parent00c3d07c61eb41cfb5ef7afd46e0be87511ed671 (diff)
some -Wall
-rw-r--r--sbin/disklabel/disklabel.c6
-rw-r--r--sbin/fsck/preen.c4
-rw-r--r--sbin/ifconfig/ifconfig.c10
-rw-r--r--sbin/init/init.c20
-rw-r--r--sbin/ipsec/ipsecadm/xf_grp.c4
-rw-r--r--sbin/ipsec/photurisd/api.c3
-rw-r--r--sbin/ipsec/photurisd/config.c4
-rw-r--r--sbin/ipsec/photurisd/kernel.c4
-rw-r--r--sbin/ipsec/photurisd/photurisd.c4
-rw-r--r--sbin/ipsec/rt/rt.c2
-rw-r--r--sbin/ipsec/rtdelete/rtdelete.c2
-rw-r--r--sbin/kbd/kbd_i386.c3
-rw-r--r--sbin/kbd/main.c3
13 files changed, 37 insertions, 32 deletions
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c
index b41339e7b6b..4e454fa9667 100644
--- a/sbin/disklabel/disklabel.c
+++ b/sbin/disklabel/disklabel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.c,v 1.36 1997/09/03 22:39:12 mickey Exp $ */
+/* $OpenBSD: disklabel.c,v 1.37 1997/09/14 10:37:40 deraadt Exp $ */
/* $NetBSD: disklabel.c,v 1.30 1996/03/14 19:49:24 ghudson Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char rcsid[] = "$OpenBSD: disklabel.c,v 1.36 1997/09/03 22:39:12 mickey Exp $";
+static char rcsid[] = "$OpenBSD: disklabel.c,v 1.37 1997/09/14 10:37:40 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -1061,7 +1061,7 @@ getasciilabel(f, lp)
lp->d_sbsize = SBSIZE; /* XXX */
while (fgets(line, sizeof(line) - 1, f)) {
lineno++;
- if (cp = strpbrk(line, "#\r\n"))
+ if ((cp = strpbrk(line, "#\r\n")))
*cp = '\0';
cp = skip(line);
if (cp == NULL)
diff --git a/sbin/fsck/preen.c b/sbin/fsck/preen.c
index abcb2eb4b5f..e247acaf78f 100644
--- a/sbin/fsck/preen.c
+++ b/sbin/fsck/preen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: preen.c,v 1.3 1996/10/20 08:36:27 tholo Exp $ */
+/* $OpenBSD: preen.c,v 1.4 1997/09/14 10:37:42 deraadt Exp $ */
/* $NetBSD: preen.c,v 1.15 1996/09/28 19:21:42 christos Exp $ */
/*
@@ -252,7 +252,7 @@ finddisk(name)
const char *name;
{
const char *p;
- size_t len;
+ size_t len = 0;
struct diskentry *d;
for (p = name + strlen(name) - 1; p >= name; --p)
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 4f0cd60c2f2..ca1ddb986dd 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.9 1997/08/24 20:31:50 deraadt Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.10 1997/09/14 10:37:44 deraadt Exp $ */
/* $NetBSD: ifconfig.c,v 1.22 1996/01/04 20:11:20 pk Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
#else
-static char rcsid[] = "$OpenBSD: ifconfig.c,v 1.9 1997/08/24 20:31:50 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: ifconfig.c,v 1.10 1997/09/14 10:37:44 deraadt Exp $";
#endif
#endif /* not lint */
@@ -790,9 +790,9 @@ in_getaddr(s, which)
sin->sin_family = AF_INET;
if (inet_aton(s, &sin->sin_addr) == 0) {
- if (hp = gethostbyname(s))
+ if ((hp = gethostbyname(s)))
memcpy(&sin->sin_addr, hp->h_addr, hp->h_length);
- else if (np = getnetbyname(s))
+ else if ((np = getnetbyname(s)))
sin->sin_addr = inet_makeaddr(np->n_net, INADDR_ANY);
else
errx(1, "%s: bad value", s);
@@ -818,7 +818,7 @@ printb(s, v, bits)
bits++;
if (bits) {
putchar('<');
- while (i = *bits++) {
+ while ((i = *bits++)) {
if (v & (1 << (i-1))) {
if (any)
putchar(',');
diff --git a/sbin/init/init.c b/sbin/init/init.c
index 7ea3af3ecb3..fb599f083b8 100644
--- a/sbin/init/init.c
+++ b/sbin/init/init.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init.c,v 1.10 1997/06/25 18:18:58 kstailey Exp $ */
+/* $OpenBSD: init.c,v 1.11 1997/09/14 10:37:45 deraadt Exp $ */
/* $NetBSD: init.c,v 1.22 1996/05/15 23:29:33 jtc Exp $ */
/*-
@@ -47,7 +47,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)init.c 8.2 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: init.c,v 1.10 1997/06/25 18:18:58 kstailey Exp $";
+static char rcsid[] = "$OpenBSD: init.c,v 1.11 1997/09/14 10:37:45 deraadt Exp $";
#endif
#endif /* not lint */
@@ -298,7 +298,7 @@ handle(va_alist)
sa.sa_handler = handler;
sigfillset(&mask_everything);
- while (sig = va_arg(ap, int)) {
+ while ((sig = va_arg(ap, int))) {
sa.sa_mask = mask_everything;
/* XXX SA_RESTART? */
sa.sa_flags = sig == SIGCHLD ? SA_NOCLDSTOP : 0;
@@ -329,7 +329,7 @@ delset(va_alist)
va_start(ap, maskp);
#endif
- while (sig = va_arg(ap, int))
+ while ((sig = va_arg(ap, int)))
sigdelset(maskp, sig);
va_end(ap);
}
@@ -900,7 +900,7 @@ construct_argv(command)
if ((argv[argc++] = strtok(command, separators)) == 0)
return 0;
- while (argv[argc++] = strtok(NULL, separators))
+ while ((argv[argc++] = strtok(NULL, separators)))
continue;
return argv;
}
@@ -1032,8 +1032,8 @@ read_ttys()
* Allocate a session entry for each active port.
* Note that sp starts at 0.
*/
- while (typ = getttyent())
- if (snext = new_session(sp, ++session_index, typ))
+ while ((typ = getttyent()))
+ if ((snext = new_session(sp, ++session_index, typ)))
sp = snext;
endttyent();
@@ -1187,11 +1187,11 @@ collect_child(pid)
sp->se_process = 0;
if (sp->se_flags & SE_SHUTDOWN) {
- if (sprev = sp->se_prev)
+ if ((sprev = sp->se_prev))
sprev->se_next = sp->se_next;
else
sessions = sp->se_next;
- if (snext = sp->se_next)
+ if ((snext = sp->se_next))
snext->se_prev = sp->se_prev;
free_session(sp);
return;
@@ -1291,7 +1291,7 @@ clean_ttys()
sp->se_flags &= ~SE_PRESENT;
devlen = sizeof(_PATH_DEV) - 1;
- while (typ = getttyent()) {
+ while ((typ = getttyent())) {
++session_index;
for (sprev = 0, sp = sessions; sp; sprev = sp, sp = sp->se_next)
diff --git a/sbin/ipsec/ipsecadm/xf_grp.c b/sbin/ipsec/ipsecadm/xf_grp.c
index 993d41a182e..4b2c647f119 100644
--- a/sbin/ipsec/ipsecadm/xf_grp.c
+++ b/sbin/ipsec/ipsecadm/xf_grp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xf_grp.c,v 1.7 1997/08/26 12:04:46 provos Exp $ */
+/* $OpenBSD: xf_grp.c,v 1.8 1997/09/14 10:37:47 deraadt Exp $ */
/*
* The author of this code is John Ioannidis, ji@tla.org,
* (except when noted otherwise).
@@ -62,8 +62,6 @@ struct in_addr dst, dst2;
u_int32_t spi, spi2;
int proto, proto2;
{
- int i;
-
struct encap_msghdr *em;
bzero(buf, EMT_GRPSPIS_FLEN);
diff --git a/sbin/ipsec/photurisd/api.c b/sbin/ipsec/photurisd/api.c
index 8bde65d4369..fde4257a3d8 100644
--- a/sbin/ipsec/photurisd/api.c
+++ b/sbin/ipsec/photurisd/api.c
@@ -37,7 +37,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: api.c,v 1.2 1997/07/22 11:18:19 provos Exp $";
+static char rcsid[] = "$Id: api.c,v 1.3 1997/09/14 10:37:48 deraadt Exp $";
#endif
#define _API_C_
@@ -49,6 +49,7 @@ static char rcsid[] = "$Id: api.c,v 1.2 1997/07/22 11:18:19 provos Exp $";
#include <sys/time.h>
#include <arpa/inet.h>
#include <unistd.h>
+#include <stdlib.h>
#include <string.h>
#include "state.h"
#include "photuris.h"
diff --git a/sbin/ipsec/photurisd/config.c b/sbin/ipsec/photurisd/config.c
index 4b5bc370c40..d3a24512921 100644
--- a/sbin/ipsec/photurisd/config.c
+++ b/sbin/ipsec/photurisd/config.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: config.c,v 1.4 1997/07/24 23:47:09 provos Exp $";
+static char rcsid[] = "$Id: config.c,v 1.5 1997/09/14 10:37:49 deraadt Exp $";
#endif
#define _CONFIG_C_
@@ -588,7 +588,7 @@ startup_end(struct stateob *st)
int
init_startup(void)
{
- char *p, *p2;
+ char *p2;
struct stateob *st = NULL;
#ifdef DEBUG
diff --git a/sbin/ipsec/photurisd/kernel.c b/sbin/ipsec/photurisd/kernel.c
index 4ac77a8b703..09d33c7116b 100644
--- a/sbin/ipsec/photurisd/kernel.c
+++ b/sbin/ipsec/photurisd/kernel.c
@@ -29,7 +29,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: kernel.c,v 1.3 1997/07/26 20:55:16 provos Exp $";
+static char rcsid[] = "$Id: kernel.c,v 1.4 1997/09/14 10:37:51 deraadt Exp $";
#endif
#include <sys/param.h>
@@ -115,7 +115,7 @@ kernel_reserve_spi(char *srcaddress, int options)
u_int32_t spi;
int proto;
- if (options & (IPSEC_OPT_ENC|IPSEC_OPT_AUTH) !=
+ if ((options & (IPSEC_OPT_ENC|IPSEC_OPT_AUTH)) !=
(IPSEC_OPT_ENC|IPSEC_OPT_AUTH)) {
switch(options & (IPSEC_OPT_ENC|IPSEC_OPT_AUTH)) {
case IPSEC_OPT_ENC:
diff --git a/sbin/ipsec/photurisd/photurisd.c b/sbin/ipsec/photurisd/photurisd.c
index bb6fcaf60b2..0b9aef231ce 100644
--- a/sbin/ipsec/photurisd/photurisd.c
+++ b/sbin/ipsec/photurisd/photurisd.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: photurisd.c,v 1.4 1997/08/26 13:39:36 niklas Exp $";
+static char rcsid[] = "$Id: photurisd.c,v 1.5 1997/09/14 10:37:52 deraadt Exp $";
#endif
#define _PHOTURIS_C_
@@ -172,5 +172,5 @@ main(int argc, char **argv)
#endif
server();
-
+ exit(0);
}
diff --git a/sbin/ipsec/rt/rt.c b/sbin/ipsec/rt/rt.c
index 385bf18342a..3e4cfd3129a 100644
--- a/sbin/ipsec/rt/rt.c
+++ b/sbin/ipsec/rt/rt.c
@@ -52,6 +52,7 @@
char buf[2048];
+int
main(int argc, char **argv)
{
struct sockaddr_encap *dst, *msk, *gw;
@@ -142,4 +143,5 @@ main(int argc, char **argv)
if (write(sd, (caddr_t) buf, rtm->rtm_msglen) < 0)
perror("write");
+ exit(0);
}
diff --git a/sbin/ipsec/rtdelete/rtdelete.c b/sbin/ipsec/rtdelete/rtdelete.c
index 045889fc1ce..f203e627397 100644
--- a/sbin/ipsec/rtdelete/rtdelete.c
+++ b/sbin/ipsec/rtdelete/rtdelete.c
@@ -51,6 +51,7 @@
char buf[2048];
+int
main(int argc, char **argv)
{
struct sockaddr_encap *dst, *msk;
@@ -114,4 +115,5 @@ main(int argc, char **argv)
if (write(sd, (caddr_t) buf, rtm->rtm_msglen) < 0)
perror("write");
+ exit(0);
}
diff --git a/sbin/kbd/kbd_i386.c b/sbin/kbd/kbd_i386.c
index 53fcfeeffcf..036f973b2a9 100644
--- a/sbin/kbd/kbd_i386.c
+++ b/sbin/kbd/kbd_i386.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kbd_i386.c,v 1.5 1996/09/01 16:48:07 deraadt Exp $ */
+/* $OpenBSD: kbd_i386.c,v 1.6 1997/09/14 10:37:57 deraadt Exp $ */
/*
* Copyright (c) 1996 Juergen Hannken-Illjes
@@ -35,6 +35,7 @@
#include <sys/types.h>
#include <machine/pccons.h>
#include <paths.h>
+#include <unistd.h>
#include <fcntl.h>
#include <err.h>
#include <stdio.h>
diff --git a/sbin/kbd/main.c b/sbin/kbd/main.c
index c738f1e9fca..b159d7b3e95 100644
--- a/sbin/kbd/main.c
+++ b/sbin/kbd/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.2 1996/06/30 05:16:28 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.3 1997/09/14 10:37:58 deraadt Exp $ */
/*
* Copyright (c) 1996 Juergen Hannken-Illjes
@@ -48,6 +48,7 @@ usage()
exit(1);
}
+int
main(argc, argv)
int argc;
char **argv;