summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2014-04-25 14:58:37 +0200
committerTobias Klauser <tklauser@distanz.ch>2014-04-25 14:58:37 +0200
commitc16a59f19ec24b0882dec6969cf59dfb29220774 (patch)
treeca4fd9072323e6c16542407b209eaff66ec81813
parentf8206181da2a8d7e24c60d19f2193cf8f5ebe54e (diff)
ifpps: Fix coding style
Fix spacing and move a pointer increment out of the for loop initializer. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--ifpps.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ifpps.c b/ifpps.c
index 785a882..0d13b08 100644
--- a/ifpps.c
+++ b/ifpps.c
@@ -233,9 +233,9 @@ static int stats_proc_net_dev(const char *ifname, struct ifstat *stats)
if (!fp)
panic("Cannot open /proc/net/dev!\n");
- ifname_colon = xstrndup(ifname, strlen(ifname)+2);
+ ifname_colon = xstrndup(ifname, strlen(ifname) + 2);
ifname_colon[strlen(ifname)] = ':';
- ifname_colon[strlen(ifname)+1] = '\0';
+ ifname_colon[strlen(ifname) + 1] = '\0';
if (fgets(buff, sizeof(buff), fp)) { ; }
if (fgets(buff, sizeof(buff), fp)) { ; }
@@ -243,7 +243,7 @@ static int stats_proc_net_dev(const char *ifname, struct ifstat *stats)
memset(buff, 0, sizeof(buff));
while (fgets(buff, sizeof(buff), fp) != NULL) {
- buff[sizeof(buff) -1] = 0;
+ buff[sizeof(buff) - 1] = 0;
if (strstr(buff, ifname_colon) == NULL)
continue;
@@ -362,7 +362,9 @@ static int stats_proc_softirqs(struct ifstat *stats)
else
continue;
- for (ptr += strlen("NET_xX:"), i = 0; i < cpus; ++i) {
+ ptr += strlen("NET_xX:");
+
+ for (i = 0; i < cpus; ++i) {
switch (net_type) {
case softirqs_net_tx:
stats->irqs_stx[i] = strtol(ptr, &ptr, 10);