diff options
| author | oy <Tom_Adams@web.de> | 2011-04-05 20:06:41 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-04-05 20:06:41 +0200 |
| commit | 9b97eb282aabfacf5175f5e0974fada07632f2e8 (patch) | |
| tree | 60a3c56452e46b281dfa5428698b8a81047578ee /src/game/server | |
| parent | 923153ca700942eb52e7acb70b94785774dbbab2 (diff) | |
| download | zcatch-9b97eb282aabfacf5175f5e0974fada07632f2e8.tar.gz zcatch-9b97eb282aabfacf5175f5e0974fada07632f2e8.zip | |
prevent that you can add votes with an empty description
Diffstat (limited to 'src/game/server')
| -rw-r--r-- | src/game/server/gamecontext.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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); |