about summary refs log tree commit diff
path: root/meminfo.c
diff options
context:
space:
mode:
authorHeikki Kallasjoki <fis@zem.fi>2018-12-12 18:08:06 +0000
committerHeikki Kallasjoki <fis+github@zem.fi>2018-12-12 18:10:51 +0000
commitd03dea4d7dbfb62ed0c3c21cdd9ad350f0526432 (patch)
treea871df40e91ecdb8f07428d7f278d527f2bbd4b6 /meminfo.c
parent7ec8aa9fcfba92019f537cd19dac4ce15674ddd6 (diff)
downloadnano-exporter-d03dea4d7dbfb62ed0c3c21cdd9ad350f0526432.tar.gz
nano-exporter-d03dea4d7dbfb62ed0c3c21cdd9ad350f0526432.tar.xz
nano-exporter-d03dea4d7dbfb62ed0c3c21cdd9ad350f0526432.zip
Allow meminfo metric values that are followed by a newline.
Fixes #8.
Diffstat (limited to 'meminfo.c')
-rw-r--r--meminfo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/meminfo.c b/meminfo.c
index 9ee1712..407b946 100644
--- a/meminfo.c
+++ b/meminfo.c
@@ -74,7 +74,7 @@ static void meminfo_collect(scrape_req *req, void *ctx) {
     do p++; while (*p == ' ');
 
     double value = strtod(p, &p);
-    if (*p != '\0' && *p != ' ')
+    if (*p != '\0' && *p != '\n' && *p != ' ')
       continue;
 
     if (*p == ' ') {