summaryrefslogtreecommitdiff
path: root/modules/devices/battery.c
diff options
context:
space:
mode:
authorLeandro Pereira <leandro@hardinfo.org>2016-01-07 00:55:07 -0200
committerLeandro Pereira <leandro@hardinfo.org>2016-01-07 00:55:07 -0200
commit515e53b4faba2e164c900f389bc75b0384eb8ee9 (patch)
treefd0b503e324a9afb8af6d40028d78dd136cca7be /modules/devices/battery.c
parentab650c847375cdb3e15901df79e97e6e56447d9d (diff)
Avoid potential crash if there's leading whitespace
Diffstat (limited to 'modules/devices/battery.c')
-rw-r--r--modules/devices/battery.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/devices/battery.c b/modules/devices/battery.c
index 3bce2d42..cbcebb12 100644
--- a/modules/devices/battery.c
+++ b/modules/devices/battery.c
@@ -234,7 +234,7 @@ read_contents(const gchar *base, const gchar *key)
}
free(path);
- return g_strstrip(value);
+ return g_strchomp(value);
}
static void