From: octo Date: Thu, 27 Apr 2006 20:52:32 +0000 (+0000) Subject: Applied patch by Peter Holik to work with arbitary length device names (when using... X-Git-Tag: svn-trunk~39 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=ee1f592882fd179b088dcc908f44a6c38726f745;p=collectd.git Applied patch by Peter Holik to work with arbitary length device names (when using the `KERNEL_LINUX' read method). --- diff --git a/src/traffic.c b/src/traffic.c index 713b01a4..07c9ecfb 100644 --- a/src/traffic.c +++ b/src/traffic.c @@ -281,9 +281,10 @@ static void traffic_read (void) while (fgets (buffer, 1024, fh) != NULL) { - if (buffer[6] != ':') + if (!(dummy = strchr(buffer, ':'))) continue; - buffer[6] = '\0'; + dummy[0] = '\0'; + dummy++; device = buffer; while (device[0] == ' ') @@ -292,7 +293,6 @@ static void traffic_read (void) if (device[0] == '\0') continue; - dummy = buffer + 7; numfields = strsplit (dummy, fields, 16); if (numfields < 9)