summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-06-13 10:15:21 +0200
committerDave Davenport <qball@gmpclient.org>2017-06-13 10:16:40 +0200
commita3c1ff7d94031e4f1a4b97452de90b8dce1ff8b8 (patch)
treeea9ed8129c65a9f1d68531f74b4784db9a5b4f75
parent306198074157bbb3f66ab7b60d348c239aee6b10 (diff)
[helper] Fix type issue with variadic function.
* https://www.securecoding.cert.org/confluence/display/c/DCL11-C.+Understand+the+type+issues+associated+with+variadic+functions
-rw-r--r--source/dialogs/ssh.c2
-rw-r--r--source/dialogs/window.c2
-rw-r--r--source/helper.c10
-rw-r--r--source/view.c2
4 files changed, 8 insertions, 8 deletions
diff --git a/source/dialogs/ssh.c b/source/dialogs/ssh.c
index dc2151db..5ce66289 100644
--- a/source/dialogs/ssh.c
+++ b/source/dialogs/ssh.c
@@ -79,7 +79,7 @@ static int execshssh ( const char *host )
char **args = NULL;
int argsv = 0;
- helper_parse_setup ( config.ssh_command, &args, &argsv, "{host}", host, NULL );
+ helper_parse_setup ( config.ssh_command, &args, &argsv, "{host}", host, (char *) 0 );
gsize l = strlen ( "Connecting to '' via rofi" ) + strlen ( host ) + 1;
gchar *desc = g_newa ( gchar, l );
diff --git a/source/dialogs/window.c b/source/dialogs/window.c
index f3276ba2..9b037573 100644
--- a/source/dialogs/window.c
+++ b/source/dialogs/window.c
@@ -546,7 +546,7 @@ static inline int act_on_window ( xcb_window_t window )
g_snprintf ( window_regex, sizeof window_regex, "%d", window );
- helper_parse_setup ( config.window_command, &args, &argc, "{window}", window_regex, NULL );
+ helper_parse_setup ( config.window_command, &args, &argc, "{window}", window_regex, (char *) 0 );
GError *error = NULL;
g_spawn_async ( NULL, args, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error );
diff --git a/source/helper.c b/source/helper.c
index 76835538..fbae3ef6 100644
--- a/source/helper.c
+++ b/source/helper.c
@@ -117,11 +117,11 @@ int helper_parse_setup ( char * string, char ***output, int *length, ... )
va_start ( ap, length );
while ( 1 ) {
char * key = va_arg ( ap, char * );
- if ( key == NULL ) {
+ if ( key == (char *) 0 ) {
break;
}
char *value = va_arg ( ap, char * );
- if ( value == NULL ) {
+ if ( value == (char *) 0 ) {
break;
}
g_hash_table_insert ( h, key, value );
@@ -476,7 +476,7 @@ int execute_generator ( const char * cmd )
{
char **args = NULL;
int argv = 0;
- helper_parse_setup ( config.run_command, &args, &argv, "{cmd}", cmd, NULL );
+ helper_parse_setup ( config.run_command, &args, &argv, "{cmd}", cmd, (char *) 0 );
int fd = -1;
GError *error = NULL;
@@ -994,10 +994,10 @@ gboolean helper_execute_command ( const char *wd, const char *cmd, gboolean run_
int argc = 0;
if ( run_in_term ) {
- helper_parse_setup ( config.run_shell_command, &args, &argc, "{cmd}", cmd, NULL );
+ helper_parse_setup ( config.run_shell_command, &args, &argc, "{cmd}", cmd, (char *) 0 );
}
else {
- helper_parse_setup ( config.run_command, &args, &argc, "{cmd}", cmd, NULL );
+ helper_parse_setup ( config.run_command, &args, &argc, "{cmd}", cmd, (char *) 0 );
}
if ( context != NULL ) {
diff --git a/source/view.c b/source/view.c
index 5ecf167d..c9a11d88 100644
--- a/source/view.c
+++ b/source/view.c
@@ -311,7 +311,7 @@ static void rofi_view_calculate_window_position ( RofiViewState *state )
state->x = CacheState.mon.x;
break;
case WL_CENTER:
- ;__attribute__ ( ( fallthrough ) );
+ ; __attribute__ ( ( fallthrough ) );
default:
break;
}