summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-04-21 09:37:03 +0200
committerDave Davenport <qball@gmpclient.org>2017-04-21 09:37:03 +0200
commit01159b29f009977da975ff8c2d648ec0d2881e40 (patch)
treea9d2f223bd0e7e1ab6267949f623f4c4a61bed3d /source
parent5edc7398485c000860068da6456a5b74a3709af4 (diff)
[Mode] Make the name field a pointer instead of a fixed 32char array.
Diffstat (limited to 'source')
-rw-r--r--source/dialogs/script.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/dialogs/script.c b/source/dialogs/script.c
index b2fd1fd9..566ca8b5 100644
--- a/source/dialogs/script.c
+++ b/source/dialogs/script.c
@@ -91,6 +91,7 @@ static void script_switcher_free ( Mode *sw )
if ( sw == NULL ) {
return;
}
+ g_free ( sw->name );
g_free ( sw->ed );
g_free ( sw );
}
@@ -182,7 +183,7 @@ Mode *script_switcher_parse_setup ( const char *str )
const char *const sep = ":";
for ( char *token = strtok_r ( parse, sep, &endp ); token != NULL; token = strtok_r ( NULL, sep, &endp ) ) {
if ( index == 0 ) {
- g_strlcpy ( sw->name, token, 32 );
+ sw->name = g_strdup ( token );
}
else if ( index == 1 ) {
sw->ed = (void *) rofi_expand_path ( token );
@@ -203,7 +204,7 @@ Mode *script_switcher_parse_setup ( const char *str )
return sw;
}
- g_warning ( "The script command '%s' has %u options, but needs 2: <name>:<script>.", str, index );
+ fprintf ( stderr, "The script command '%s' has %u options, but needs 2: <name>:<script>.", str, index );
script_switcher_free ( sw );
return NULL;
}