diff options
| author | Ondrej Čerman <ondrej.cerman@gmail.com> | 2018-11-28 13:32:44 +0100 | 
|---|---|---|
| committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2018-11-30 04:57:01 -0800 | 
| commit | 0f3cf14d062ccd89467ecd933081b18a4e6636b9 (patch) | |
| tree | bd1333e1c90c3c8b0a786c614f7e32c8aeefc86b | |
| parent | 772ba83e7a83f22773909d95958e178144e7c577 (diff) | |
computer/os: fix loop in parse_os_release
| -rw-r--r-- | modules/computer/os.c | 8 | 
1 files changed, 4 insertions, 4 deletions
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;  | 
