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 /games/hack | |
parent | 8f00f23a2b0f39900bb1c2ab894a58e956979ffd (diff) |
remove some warnings:
unused variable `variable'
`variable' might be used uninitialized in this function
ok gilles@ ray@
Diffstat (limited to 'games/hack')
-rw-r--r-- | games/hack/hack.pager.c | 9 |
1 files changed, 5 insertions, 4 deletions
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); |