diff options
Diffstat (limited to 'src/script.c')
-rw-r--r-- | src/script.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/script.c b/src/script.c index 6e6569f..2424904 100644 --- a/src/script.c +++ b/src/script.c @@ -82,7 +82,7 @@ eterm_handle_winop(char *action) char *winid; Window win = 0; - ASSERT(!!action); + ASSERT(action != NULL); winid = strchr(action, ' '); if (winid) { @@ -160,7 +160,7 @@ script_handler_copy(spif_charptr_t *params) Atom sel = XA_PRIMARY; if (params) { - for (i = 0; (buffer_id = params[i]); i++) { + for (i = 0; (buffer_id = params[i]) != NULL; i++) { if (*buffer_id) { if (*buffer_id >= '0' && *buffer_id <= '7') { sel = (Atom) ((int) XA_CUT_BUFFER0 + (int) (*buffer_id - '0')); @@ -261,7 +261,7 @@ script_handler_paste(spif_charptr_t *params) Atom sel = XA_PRIMARY; if (params) { - for (i = 0; (buffer_id = params[i]); i++) { + for (i = 0; (buffer_id = params[i]) != NULL; i++) { if (*buffer_id) { if (*buffer_id >= '0' && *buffer_id <= '7') { sel = (Atom) ((int) XA_CUT_BUFFER0 + (int) (*buffer_id - '0')); @@ -389,7 +389,7 @@ script_handler_search(spif_charptr_t *params) static char *search = NULL; if (params && *params) { - if (search) { + if (search != NULL) { FREE(search); } search = STRDUP(*params); @@ -735,12 +735,12 @@ script_parse(char *s) size_t len; eterm_script_handler_t *func; - REQUIRE(!!s); + REQUIRE(s != NULL); D_SCRIPT(("Parsing: \"%s\"\n", s)); token_list = spiftool_split(";", s); - if (!token_list) { + if (token_list == NULL) { D_SCRIPT(("No tokens found; ignoring script.\n")); return; } @@ -751,7 +751,7 @@ script_parse(char *s) if (!(*pstr)) { continue; } - if ((params = strchr(pstr, '('))) { + if ((params = strchr(pstr, '(')) != NULL) { if (params != pstr) { len = params - pstr; func_name = (char *) MALLOC(len + 1); @@ -771,7 +771,7 @@ script_parse(char *s) } if (params) { params++; - if ((tmp = strrchr(params, ')'))) { + if ((tmp = strrchr(params, ')')) != NULL) { *tmp = 0; } else { libast_print_error("Error in script \"%s\": Missing closing parentheses for \"%s\".\n", s, token_list[i]); @@ -783,7 +783,7 @@ script_parse(char *s) param_list = NULL; } D_SCRIPT(("Calling function %s with parameters: %s\n", func_name, NONULL(params))); - if ((func = script_find_handler(func_name))) { + if ((func = script_find_handler(func_name)) != NULL) { (func->handler) (param_list); } else { libast_print_error("Error in script \"%s\": No such function \"%s\".\n", s, func_name); |