]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
text-progress-bar: fix os string parsing
authorRay Strode <rstrode@redhat.com>
Mon, 10 Dec 2012 16:50:07 +0000 (11:50 -0500)
committerRay Strode <rstrode@redhat.com>
Mon, 10 Dec 2012 16:50:07 +0000 (11:50 -0500)
If there's no newline the the end of string variable will be NULL
instead of at the end of string.

src/libply-splash-core/ply-text-progress-bar.c

index ea92d49fa2bbdcc84ea3310212d1873652bfeb2b..8c4e75924ad54d12d77ab6d3ca83d8bf68e6b7a2 100644 (file)
@@ -136,6 +136,8 @@ get_os_string (void)
 
           if (pos2 != NULL)
             *pos2 = '\0';
+          else
+            pos2 = pos + strlen(pos) - 1;
 
           if ((*pos == '\"' && pos2[-1] == '\"') ||
               (*pos == '\'' && pos2[-1] == '\''))