text-progress-bar: fix os string parsing

If there's no newline the the end of string variable will be NULL
instead of at the end of string.
This commit is contained in:
Ray Strode 2012-12-10 11:50:07 -05:00
parent 73f1d3e44f
commit b5cfd7fb30

View 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] == '\''))