diff options
author | Charles Longeau <chl@cvs.openbsd.org> | 2007-09-14 14:29:21 +0000 |
---|---|---|
committer | Charles Longeau <chl@cvs.openbsd.org> | 2007-09-14 14:29:21 +0000 |
commit | 9f2d925dffdb4c245e7ccf857babe10c77b17518 (patch) | |
tree | 765ec3993a05497beaad5221beb15083f2b1d1f7 /usr.bin | |
parent | 8f00f23a2b0f39900bb1c2ab894a58e956979ffd (diff) |
remove some warnings:
unused variable `variable'
`variable' might be used uninitialized in this function
ok gilles@ ray@
Diffstat (limited to 'usr.bin')
-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 |
6 files changed, 14 insertions, 15 deletions
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); } |