Append ':' after Switcher name.

This commit is contained in:
Dave Davenport 2014-07-22 18:04:42 +02:00
parent 43bc36c1a6
commit 8cecc27992
1 changed files with 4 additions and 1 deletions

View File

@ -185,7 +185,10 @@ ScriptOptions *script_switcher_parse_setup ( const char *str )
// TODO: This is naive and can be improved.
for ( char *token = strtok_r ( parse, ":", &endp ); token != NULL; token = strtok_r ( NULL, ":", &endp ) ) {
if ( index == 0 ) {
sw->name = strdup ( token );
if(asprintf(&(sw->name), "%s:", token) <= 0) {
fprintf(stderr, "Failed to allocate string.\n");
abort();
}
}
else if ( index == 1 ) {
sw->script_path = strdup ( token );