From 9b97eb282aabfacf5175f5e0974fada07632f2e8 Mon Sep 17 00:00:00 2001 From: oy Date: Tue, 5 Apr 2011 20:06:41 +0200 Subject: prevent that you can add votes with an empty description --- src/game/server/gamecontext.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/game/server/gamecontext.cpp') diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 8958833c..a0c1c64a 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -1072,7 +1072,9 @@ void CGameContext::ConAddVote(IConsole::IResult *pResult, void *pUserData) pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", aBuf); return; } - if(str_length(pDescription) >= VOTE_DESC_LENGTH) + while(*pDescription && *pDescription == ' ') + pDescription++; + if(str_length(pDescription) >= VOTE_DESC_LENGTH || *pDescription == 0) { char aBuf[256]; str_format(aBuf, sizeof(aBuf), "skipped invalid option '%s'", pDescription); -- cgit 1.4.1