[Pkg-wmaker-commits] [wmppp.app] 76/120: wmppp.app: Reduce scope of several variables.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Thu Aug 27 12:04:37 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmppp.app.

commit 1d92ac2d7bfb5adb10d502497b7b09bbe07e116d
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Tue May 19 22:30:58 2015 -0500

    wmppp.app: Reduce scope of several variables.
    
    Fixes several "(style) The scope of the variable 'p' can be reduced" found
    by cppcheck.
---
 wmppp.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/wmppp.c b/wmppp.c
index 7e4ecdc..10e3ebe 100644
--- a/wmppp.c
+++ b/wmppp.c
@@ -375,13 +375,12 @@ void wmppp_routine(int argc, char **argv) {
 		{ NULL, NULL }
 	};
 
-	int				i,j;
+	int			j;
 
 	int				but_stat;
 
 	long			starttime;
 	long			currenttime;
-	long			lasttime;
 	long			waittime;
 	long			ppptime;
 	int				hour,minute;
@@ -450,6 +449,9 @@ void wmppp_routine(int argc, char **argv) {
 
 /* wmppp main loop */
 	while (1) {
+		int i;
+		long lasttime;
+
 		lasttime = currenttime;
 		currenttime = time(0);
 		/* Check if any child has left the playground */
@@ -688,12 +690,12 @@ int get_statistics(char *devname, long *ip, long *op, long *is, long *os) {
 int stillonline(char *ifs) {
 
 	FILE	*fp;
-	char	temp[128];
 	int		i;
 
 	i = 0;
 	fp = fopen("/proc/net/route", "r");
 	if (fp) {
+		char temp[128];
 		while (fgets(temp, 128, fp)) {
 			if (strstr(temp, ifs)) {
 				i = 1; /* Line is alive */
@@ -793,14 +795,16 @@ void PrintLittle(int i, int *k) {
 
 void DrawSpeedInd(char *speed_action) {
 
-	int		linespeed, i, k;
+	int	k;
 	FILE	*fp;
-	char	*p;
-	char	temp[128];
 
 	fp = popen(speed_action, "r");
 
 	if (fp) {
+		char *p;
+		char temp[128];
+		int i, linespeed;
+
 		linespeed = 0;
 
 		while (fgets(temp, 128, fp))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmppp.app.git



More information about the Pkg-wmaker-commits mailing list