diff options
author | Mathieu Duponchelle <mathieu.duponchelle@opencreed.com> | 2015-03-24 13:01:39 +0100 |
---|---|---|
committer | Mathieu Duponchelle <mathieu.duponchelle@opencreed.com> | 2015-03-24 13:01:39 +0100 |
commit | b55265c70dfdb2fefa01d88399aeb10507ffc150 (patch) | |
tree | c3eb1c995df202dfc3674e2b56b4091ceb1c8673 /tools | |
parent | 44a0924c1f6b07f0c91ee8bd03d3ae5d97da92d5 (diff) |
Revert "ges-launch: no need for a tmp string pointer"
This reverts commit 44a0924c1f6b07f0c91ee8bd03d3ae5d97da92d5.
There indeed is a need for a tmp string pointer.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/ges-launch.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/ges-launch.c b/tools/ges-launch.c index 8147eb9d..d30088a6 100644 --- a/tools/ges-launch.c +++ b/tools/ges-launch.c @@ -592,6 +592,7 @@ sanitize_argument (gchar * arg) char *equal_index = strstr (arg, "="); char *space_index = strstr (arg, " "); gchar *new_string = g_malloc (sizeof (gchar) * (strlen (arg) + 3)); + gchar *tmp_string = new_string; if (!space_index) return g_strdup (arg); @@ -602,16 +603,16 @@ sanitize_argument (gchar * arg) } for (arg = arg; *arg != '\0'; arg++) { - *new_string = *arg; - new_string += 1; + *tmp_string = *arg; + tmp_string += 1; if (*arg == '=') { - *new_string = '"'; - new_string += 1; + *tmp_string = '"'; + tmp_string += 1; } } - *new_string = '"'; - new_string += 1; - *new_string = '\0'; + *tmp_string = '"'; + tmp_string += 1; + *tmp_string = '\0'; return new_string; } |