mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 00:31:13 +00:00
parse: check before truncating strings
Don't truncate the last character of a string if it isn't necessary. https://bugzilla.gnome.org/show_bug.cgi?id=688625
This commit is contained in:
parent
2064a07feb
commit
c565c5ecb4
1 changed files with 2 additions and 1 deletions
|
@ -390,7 +390,8 @@ static void gst_parse_element_set (gchar *value, GstElement *element, graph_t *g
|
||||||
}
|
}
|
||||||
pos++;
|
pos++;
|
||||||
while (g_ascii_isspace (*pos)) pos++;
|
while (g_ascii_isspace (*pos)) pos++;
|
||||||
if (*pos == '"') {
|
/* truncate a string if it is delimited with double quotes */
|
||||||
|
if (*pos == '"' && pos[strlen (pos) - 1] == '"') {
|
||||||
pos++;
|
pos++;
|
||||||
pos[strlen (pos) - 1] = '\0';
|
pos[strlen (pos) - 1] = '\0';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue