Skip to content

Commit

Permalink
computer/os: fix loop in parse_os_release
Browse files Browse the repository at this point in the history
  • Loading branch information
ocerman authored and lpereira committed Nov 30, 2018
1 parent 772ba83 commit 0f3cf14
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/computer/os.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 0f3cf14

Please sign in to comment.