diff options
-rw-r--r-- | src/conntrack.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/conntrack.c b/src/conntrack.c index 3e1cb11..b695da4 100644 --- a/src/conntrack.c +++ b/src/conntrack.c @@ -1359,10 +1359,9 @@ static int display_proc_conntrack_stats(void) /* trim off trailing \n */ nl = strchr(buf, '\n'); - if (nl != NULL) { + if (nl != NULL) *nl = '\0'; - nl = strchr(buf, '\n'); - } + token = strtok(buf, " "); for (i=0; token != NULL && i<CT_STATS_ENTRIES_MAX; i++) { strncpy(output[i], token, CT_STATS_STRING_MAX); |