Skip to content

Commit

Permalink
owl_variable_bool_get_tostring_default: Remove dead <invalid> case
Browse files Browse the repository at this point in the history
bool is 0 or 1.  Found by Coverity Scan service.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Loading branch information
andersk committed May 5, 2014
1 parent 18380fd commit 94b9ee0
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions variable.c
Expand Up @@ -1037,14 +1037,7 @@ int owl_variable_bool_set_fromstring_default(owl_variable *v, const char *newval

CALLER_OWN char *owl_variable_bool_get_tostring_default(const owl_variable *v, void *dummy)
{
bool val = owl_variable_get_bool(v);
if (val == 0) {
return g_strdup("off");
} else if (val == 1) {
return g_strdup("on");
} else {
return g_strdup("<invalid>");
}
return g_strdup(owl_variable_get_bool(v) ? "on" : "off");
}

/* default functions for integers */
Expand Down

0 comments on commit 94b9ee0

Please sign in to comment.