diff options
-rw-r--r-- | games/atc/main.c | 8 | ||||
-rw-r--r-- | games/hack/hack.pager.c | 9 | ||||
-rw-r--r-- | sbin/raidctl/rf_configure.c | 4 | ||||
-rw-r--r-- | sbin/savecore/savecore.c | 6 | ||||
-rw-r--r-- | usr.bin/file/print.c | 6 | ||||
-rw-r--r-- | usr.bin/rdist/message.c | 5 | ||||
-rw-r--r-- | usr.bin/sup/src/supcmeat.c | 4 | ||||
-rw-r--r-- | usr.bin/sup/src/supfilesrv.c | 6 | ||||
-rw-r--r-- | usr.bin/tset/tset.c | 3 | ||||
-rw-r--r-- | usr.bin/vi/common/recover.c | 5 | ||||
-rw-r--r-- | usr.sbin/sliplogin/sliplogin.c | 4 |
11 files changed, 28 insertions, 32 deletions
diff --git a/games/atc/main.c b/games/atc/main.c index ab15b9f3603..335ff78240b 100644 --- a/games/atc/main.c +++ b/games/atc/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.18 2007/09/11 15:21:05 gilles Exp $ */ +/* $OpenBSD: main.c,v 1.19 2007/09/14 14:29:20 chl Exp $ */ /* $NetBSD: main.c,v 1.4 1995/04/27 21:22:25 mycroft Exp $ */ /*- @@ -52,7 +52,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: main.c,v 1.18 2007/09/11 15:21:05 gilles Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.19 2007/09/14 14:29:20 chl Exp $"; #endif #endif /* not lint */ @@ -257,7 +257,7 @@ default_game(void) { FILE *fp; static char file[256]; - char line[256], games[256], *p; + char line[256], games[256]; strlcpy(games, _PATH_GAMES, sizeof games); strlcat(games, GAMES, sizeof games); @@ -299,8 +299,6 @@ okay_game(const char *s) return (NULL); } while (fgets(line, sizeof(line), fp) != NULL) { - char *p; - line[strcspn(line, "\n")] = '\0'; if (strcmp(s, line) == 0) { if (strlen(line) + strlen(_PATH_GAMES) >= sizeof(file)) { diff --git a/games/hack/hack.pager.c b/games/hack/hack.pager.c index 953ab7677d5..ed0b224d32d 100644 --- a/games/hack/hack.pager.c +++ b/games/hack/hack.pager.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.pager.c,v 1.13 2007/09/11 15:21:05 gilles Exp $ */ +/* $OpenBSD: hack.pager.c,v 1.14 2007/09/14 14:29:20 chl Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -62,7 +62,7 @@ */ #ifndef lint -static const char rcsid[] = "$OpenBSD: hack.pager.c,v 1.13 2007/09/11 15:21:05 gilles Exp $"; +static const char rcsid[] = "$OpenBSD: hack.pager.c,v 1.14 2007/09/14 14:29:20 chl Exp $"; #endif /* not lint */ /* This file contains the command routine dowhatis() and a pager. */ @@ -97,7 +97,8 @@ dowhatis() if(q != '\t') while(fgets(buf,BUFSZ,fp)) if(*buf == q) { - buf[strcspn(buf, "\n")] = '\0'; + ep = strchr(buf, '\n'); + if(ep) *ep = 0; /* else: bad data file */ /* Expand tab 'by hand' */ if(buf[1] == '\t'){ @@ -136,7 +137,7 @@ intruph(int notused) static void page_more(FILE *fp, int strip) { - char *bufr, *ep; + char *bufr; sig_t prevsig = signal(SIGINT, intruph); set_pager(0); diff --git a/sbin/raidctl/rf_configure.c b/sbin/raidctl/rf_configure.c index 63d91b36add..c6e4f6b37f6 100644 --- a/sbin/raidctl/rf_configure.c +++ b/sbin/raidctl/rf_configure.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rf_configure.c,v 1.17 2007/09/11 15:25:14 gilles Exp $ */ +/* $OpenBSD: rf_configure.c,v 1.18 2007/09/14 14:29:20 chl Exp $ */ /* $NetBSD: rf_configure.c,v 1.14 2001/02/04 21:05:42 christos Exp $ */ /* @@ -489,7 +489,7 @@ rf_ReadSpareTable(RF_SparetWait_t *req, char *fname) { int i, j, numFound, linecount, tableNum, tupleNum, spareDisk, spareBlkOffset; - char buf[1024], targString[100], errString[100], *p; + char buf[1024], targString[100], errString[100]; RF_SpareTableEntry_t **table; FILE *fp; diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index e89889d8235..11f1335982a 100644 --- a/sbin/savecore/savecore.c +++ b/sbin/savecore/savecore.c @@ -1,4 +1,4 @@ -/* $OpenBSD: savecore.c,v 1.43 2007/09/11 15:25:14 gilles Exp $ */ +/* $OpenBSD: savecore.c,v 1.44 2007/09/14 14:29:20 chl Exp $ */ /* $NetBSD: savecore.c,v 1.26 1996/03/18 21:16:05 leo Exp $ */ /*- @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)savecore.c 8.3 (Berkeley) 1/2/94"; #else -static char rcsid[] = "$OpenBSD: savecore.c,v 1.43 2007/09/11 15:25:14 gilles Exp $"; +static char rcsid[] = "$OpenBSD: savecore.c,v 1.44 2007/09/14 14:29:20 chl Exp $"; #endif #endif /* not lint */ @@ -312,8 +312,6 @@ check_kmem(void) core_vers[sizeof(core_vers) - 1] = '\0'; if (strcmp(vers, core_vers) && kernel == 0) { - char *p; - vers[strcspn(vers, "\n")] = '\0'; core_vers[strcspn(core_vers, "\n")] = '\0'; diff --git a/usr.bin/file/print.c b/usr.bin/file/print.c index 1271370d843..11bd3781bf6 100644 --- a/usr.bin/file/print.c +++ b/usr.bin/file/print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print.c,v 1.12 2007/09/11 15:47:17 gilles Exp $ */ +/* $OpenBSD: print.c,v 1.13 2007/09/14 14:29:20 chl Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. * Software written by Ian F. Darwin and others; @@ -42,7 +42,7 @@ #include <time.h> #ifndef lint -FILE_RCSID("@(#)$Id: print.c,v 1.12 2007/09/11 15:47:17 gilles Exp $") +FILE_RCSID("@(#)$Id: print.c,v 1.13 2007/09/14 14:29:20 chl Exp $") #endif /* lint */ #define SZOF(a) (sizeof(a) / sizeof(a[0])) @@ -155,7 +155,7 @@ file_magwarn(const char *f, ...) protected char * file_fmttime(uint32_t v, int local) { - char *pp, *rt; + char *pp; time_t t = (time_t)v; struct tm *tm; diff --git a/usr.bin/rdist/message.c b/usr.bin/rdist/message.c index 54bf099f0df..2b870f57dca 100644 --- a/usr.bin/rdist/message.c +++ b/usr.bin/rdist/message.c @@ -1,4 +1,4 @@ -/* $OpenBSD: message.c,v 1.16 2007/09/11 15:47:17 gilles Exp $ */ +/* $OpenBSD: message.c,v 1.17 2007/09/14 14:29:20 chl Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -37,7 +37,7 @@ static char RCSid[] __attribute__((__unused__)) = "$From: message.c,v 1.5 1999/11/01 00:21:39 christos Exp $"; #else static char RCSid[] __attribute__((__unused__)) = -"$OpenBSD: message.c,v 1.16 2007/09/11 15:47:17 gilles Exp $"; +"$OpenBSD: message.c,v 1.17 2007/09/14 14:29:20 chl Exp $"; #endif static char sccsid[] __attribute__((__unused__)) = @@ -510,7 +510,6 @@ static void _message(int flags, char *msgbuf) { int i, x; - char *cp; static char mbuf[2048]; if (msgbuf && *msgbuf) { diff --git a/usr.bin/sup/src/supcmeat.c b/usr.bin/sup/src/supcmeat.c index d0585ae5625..31fc1c8eb77 100644 --- a/usr.bin/sup/src/supcmeat.c +++ b/usr.bin/sup/src/supcmeat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: supcmeat.c,v 1.22 2007/09/11 15:47:17 gilles Exp $ */ +/* $OpenBSD: supcmeat.c,v 1.23 2007/09/14 14:29:20 chl Exp $ */ /* * Copyright (c) 1992 Carnegie Mellon University @@ -489,7 +489,7 @@ listfiles() { char buf[STRINGLENGTH]; char relsufix[STRINGLENGTH]; - char *p,*q; + char *p; FILE *f; int x; diff --git a/usr.bin/sup/src/supfilesrv.c b/usr.bin/sup/src/supfilesrv.c index 3a6517691b1..712a20819e8 100644 --- a/usr.bin/sup/src/supfilesrv.c +++ b/usr.bin/sup/src/supfilesrv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: supfilesrv.c,v 1.37 2007/09/11 15:47:17 gilles Exp $ */ +/* $OpenBSD: supfilesrv.c,v 1.38 2007/09/14 14:29:20 chl Exp $ */ /* * Copyright (c) 1992 Carnegie Mellon University @@ -547,7 +547,7 @@ init(argc, argv) int i; int x; char *clienthost, *clientuser; - char *p, *q; + char *p; char buf[STRINGLENGTH]; int maxsleep; FILE *f; @@ -1055,7 +1055,7 @@ void docrypt() { int x; - char *p,*q; + char *p; char buf[STRINGLENGTH]; FILE *f; struct stat sbuf; diff --git a/usr.bin/tset/tset.c b/usr.bin/tset/tset.c index 8495bff787d..b7163c571fa 100644 --- a/usr.bin/tset/tset.c +++ b/usr.bin/tset/tset.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tset.c,v 1.30 2007/09/11 15:47:17 gilles Exp $ */ +/* $OpenBSD: tset.c,v 1.31 2007/09/14 14:29:20 chl Exp $ */ /**************************************************************************** * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * @@ -182,7 +182,6 @@ static const char * askuser(const char *dflt) { static char answer[256]; - char *p; /* We can get recalled; if so, don't continue uselessly. */ if (feof(stdin) || ferror(stdin)) { diff --git a/usr.bin/vi/common/recover.c b/usr.bin/vi/common/recover.c index 6d4655d486c..6c72b0f7824 100644 --- a/usr.bin/vi/common/recover.c +++ b/usr.bin/vi/common/recover.c @@ -1,4 +1,4 @@ -/* $OpenBSD: recover.c,v 1.12 2007/09/11 15:47:17 gilles Exp $ */ +/* $OpenBSD: recover.c,v 1.13 2007/09/14 14:29:20 chl Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -817,7 +817,8 @@ rcv_gets(buf, len, fd) if ((nr = read(fd, buf, len - 1)) == -1) return (NULL); buf[nr] = '\0'; - buf[strcspn(buf, "\n")] = '\0'; + if ((p = strchr(buf, '\n')) == NULL) + return (NULL); (void)lseek(fd, (off_t)((p - buf) + 1), SEEK_SET); return (buf); } diff --git a/usr.sbin/sliplogin/sliplogin.c b/usr.sbin/sliplogin/sliplogin.c index d7eb062d032..2eddab16729 100644 --- a/usr.sbin/sliplogin/sliplogin.c +++ b/usr.sbin/sliplogin/sliplogin.c @@ -35,7 +35,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)sliplogin.c 5.6 (Berkeley) 3/2/91";*/ -static char rcsid[] = "$Id: sliplogin.c,v 1.27 2007/09/11 16:30:59 gilles Exp $"; +static char rcsid[] = "$Id: sliplogin.c,v 1.28 2007/09/14 14:29:20 chl Exp $"; #endif /* not lint */ /* @@ -109,7 +109,7 @@ findid(char *name) static char laddr[16]; static char raddr[16]; static char mask[16]; - char user[MAXLOGNAME], *p; + char user[MAXLOGNAME]; int n; strlcpy(loginname, name, sizeof loginname); |