From 9ceb1a59b45b391fcdd5272c9af395b8658537b3 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 10 Nov 2008 11:31:16 +0100 Subject: [PATCH] tag: return after warn Signed-off-by: Julien Danjou --- tag.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tag.c b/tag.c index dddc526a..ca078c78 100644 --- a/tag.c +++ b/tag.c @@ -405,7 +405,10 @@ luaA_tag_newindex(lua_State *L) if(l) (*tag)->layout = l; else + { luaA_warn(L, "unknown layout: %s", buf); + return 0; + } break; case A_TK_SELECTED: if((*tag)->screen != SCREEN_UNDEF) @@ -416,21 +419,30 @@ luaA_tag_newindex(lua_State *L) if(d > 0 && d < 1) (*tag)->mwfact = d; else + { luaA_warn(L, "bad value, must be between 0 and 1"); + return 0; + } break; case A_TK_NMASTER: i = luaL_checknumber(L, 3); if(i >= 0) (*tag)->nmaster = i; else + { luaA_warn(L, "bad value, must be greater than 0"); + return 0; + } break; case A_TK_NCOL: i = luaL_checknumber(L, 3); if(i >= 1) (*tag)->ncol = i; else + { luaA_warn(L, "bad value, must be greater than 1"); + return 0; + } break; default: return 0;