summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandmarti1424 <andmarti@gmail.com>2017-12-10 11:46:38 -0300
committerandmarti1424 <andmarti@gmail.com>2017-12-10 11:46:38 -0300
commitc287e896aee5f489cf26a4cdca8d9f8f9df93d18 (patch)
tree3afc2b91429e9206a83e585d1a12d073f50122fd
parentd567a5e18b658f741ea76f1cf5158444618d2d77 (diff)
work on issue 219
-rw-r--r--src/color.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/color.c b/src/color.c
index 5cf62fe..670ce10 100644
--- a/src/color.c
+++ b/src/color.c
@@ -261,7 +261,10 @@ void chg_color(char * str) {
char * cl;
// Validate we got enough keys to change a color
- if ( (((cl = get(d, "fg")) != NULL) && cl[0] == '\0') || (((cl = get(d, "bg")) != NULL) && cl[0] == '\0') || (((cl = get(d, "type")) != NULL) && cl[0] == '\0')) {
+ if (
+ (get(d, "fg") == NULL) ||
+ (get(d, "type") == NULL) ||
+ (get(d, "bg") == NULL)) {
sc_error("Color definition incomplete");
destroy_dictionary(d);
return;
@@ -269,6 +272,8 @@ void chg_color(char * str) {
// Validate the values for those keys are correct
if (
+ (get(d_colors_param, get(d, "bg")) == NULL) ||
+ (get(d_colors_param, get(d, "type")) == NULL) ||
(get(d_colors_param, get(d, "fg")) == NULL) ||
(get(d_colors_param, get(d, "bg")) == NULL) ||
(get(d_colors_param, get(d, "type")) == NULL) ||