From 0f3cf14d062ccd89467ecd933081b18a4e6636b9 Mon Sep 17 00:00:00 2001 From: Ondrej Čerman Date: Wed, 28 Nov 2018 13:32:44 +0100 Subject: computer/os: fix loop in parse_os_release --- modules/computer/os.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/computer/os.c b/modules/computer/os.c index c42cc473..7a8348f2 100644 --- a/modules/computer/os.c +++ b/modules/computer/os.c @@ -327,7 +327,7 @@ static gchar * parse_os_release(void) { gchar *pretty_name = NULL; - gchar **split, *contents, *line; + gchar **split, *contents, **line; if (!g_file_get_contents("/usr/lib/os-release", &contents, NULL, NULL)) return NULL; @@ -336,9 +336,9 @@ parse_os_release(void) if (!split) return NULL; - for (line = *split; *line; line++) { - if (!strncmp(line, "PRETTY_NAME=", sizeof("PRETTY_NAME=") - 1)) { - pretty_name = g_strdup(line + + for (line = split; *line; line++) { + if (!strncmp(*line, "PRETTY_NAME=", sizeof("PRETTY_NAME=") - 1)) { + pretty_name = g_strdup(*line + strlen("PRETTY_NAME=") + 1); strend(pretty_name, '"'); break; -- cgit v1.2.3