bin/71629: [PATCH] cleanup of the usr.sbin/pppstats code
Bruce Cran
bruce at cran.org.uk
Thu Sep 4 23:00:10 UTC 2008
The following reply was made to PR bin/71629; it has been noted by GNATS.
From: Bruce Cran <bruce at cran.org.uk>
To: bug-followup at FreeBSD.org, dan at obluda.cz
Cc:
Subject: Re: bin/71629: [PATCH] cleanup of the usr.sbin/pppstats code
Date: Thu, 4 Sep 2008 23:52:18 +0100
--MP_/E4gLEAeyFeE_woFG9SEkoO0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
I have attached a patch which fixes more of the warnings in pppstats.c
with high WARNS levels.
--
Bruce Cran
--MP_/E4gLEAeyFeE_woFG9SEkoO0
Content-Type: text/x-patch; name=pppstats.c.diff
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=pppstats.c.diff
--- pppstats.c.orig 2008-09-04 23:47:20.000000000 +0100
+++ pppstats.c 2008-09-04 23:50:36.000000000 +0100
@@ -70,7 +70,7 @@
int s; /* socket or /dev/ppp file descriptor */
int signalled; /* set if alarm goes off "early" */
char *progname;
-char *interface;
+const char *interface;
#if defined(SUNOS4) || defined(ULTRIX) || defined(NeXT)
extern int optind;
@@ -98,9 +98,9 @@
* Sets a flag to not wait for the alarm.
*/
static void
-catchalarm(arg)
- int arg;
+catchalarm(int arg)
{
+ (void)arg;
signalled = 1;
}
@@ -252,12 +252,13 @@
{
register int line = 0;
sigset_t oldmask, mask;
- char *bunit;
+ const char *bunit;
int ratef = 0;
struct ppp_stats cur, old;
struct ppp_comp_stats ccs, ocs;
memset(&old, 0, sizeof(old));
+ memset(&ccs, 0, sizeof(ccs));
memset(&ocs, 0, sizeof(ocs));
while (1) {
--MP_/E4gLEAeyFeE_woFG9SEkoO0--
More information about the freebsd-bugs
mailing list