summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsabetts <sabetts>2004-10-25 21:58:22 +0000
committersabetts <sabetts>2004-10-25 21:58:22 +0000
commitabf452c7c0d30acd1c7d669ffa80dbee1f90cb59 (patch)
treebe1d2a2560f2c6451f12ee04d33ef736e0c33344
parentdf762c8d7ec794c682634ee3ec79490182fd2f0d (diff)
downloadratpoison-abf452c7c0d30acd1c7d669ffa80dbee1f90cb59.zip
(cmd_set): check if var is NULL before checking strlen(var)
-rw-r--r--ChangeLog4
-rw-r--r--src/actions.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 24ae6f1..b4d5389 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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;