From 94b9ee074ae76ef2e585605ccf56f030d02378a6 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 23 Apr 2014 03:02:13 -0400 Subject: [PATCH] owl_variable_bool_get_tostring_default: Remove dead case bool is 0 or 1. Found by Coverity Scan service. Signed-off-by: Anders Kaseorg --- variable.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/variable.c b/variable.c index 600f5eabb..3ab189384 100644 --- a/variable.c +++ b/variable.c @@ -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(""); - } + return g_strdup(owl_variable_get_bool(v) ? "on" : "off"); } /* default functions for integers */