diff options
author | sabetts <sabetts> | 2004-10-25 21:58:22 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2004-10-25 21:58:22 +0000 |
commit | abf452c7c0d30acd1c7d669ffa80dbee1f90cb59 (patch) | |
tree | be1d2a2560f2c6451f12ee04d33ef736e0c33344 | |
parent | df762c8d7ec794c682634ee3ec79490182fd2f0d (diff) | |
download | ratpoison-abf452c7c0d30acd1c7d669ffa80dbee1f90cb59.zip |
(cmd_set): check if var is NULL before checking strlen(var)
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/actions.c | 3 |
2 files changed, 5 insertions, 2 deletions
@@ -1,3 +1,7 @@ +2002-02-05 Shawn Betts <katia_dilkina@verizon.net> + + * src/actions.c (cmd_set): check if var is NULL before checking strlen(var) + 2004-10-07 Shawn Betts <sabetts@vcn.bc.ca> * doc/ratpoison.texi (Frame Numbering): new topic diff --git a/src/actions.c b/src/actions.c index a5c7165..e7c283d 100644 --- a/src/actions.c +++ b/src/actions.c @@ -2761,7 +2761,6 @@ char * cmd_unsetenv (int interactive, char *data) { struct sbuf *s; - char *str; if (data == NULL) { @@ -4272,7 +4271,7 @@ cmd_set (int interactive, char *data) { char *tmp; var = get_input (MESSAGE_PROMPT_SELECT_VAR, var_completions); - if (strlen (var) == 0) + if (var == NULL || strlen (var) == 0) { free (var); return NULL; |