projects
/
zefram
/
minetest
/
minetest_engine.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
24953ba
)
Fix crash when inputting only / in chat
author
Perttu Ahola
<celeron55@gmail.com>
Thu, 5 Apr 2012 18:18:42 +0000
(21:18 +0300)
committer
Perttu Ahola
<celeron55@gmail.com>
Thu, 5 Apr 2012 18:18:42 +0000
(21:18 +0300)
src/servercommand.cpp
patch
|
blob
|
history
diff --git
a/src/servercommand.cpp
b/src/servercommand.cpp
index 2c74c81ea9d73677f0830866384d33819d8ff365..cf89f7f5635dffd4e9f6a8d34faf96e19469b8a5 100644
(file)
--- a/
src/servercommand.cpp
+++ b/
src/servercommand.cpp
@@
-160,11
+160,12
@@
void cmd_clearobjects(std::wostringstream &os,
std::wstring processServerCommand(ServerCommandContext *ctx)
{
-
std::wostringstream os(std::ios_base::binary);
ctx->flags = SEND_TO_SENDER; // Default, unless we change it.
- if(ctx->parms[0] == L"status")
+ if(ctx->parms.size() == 0)
+ os<<L"-!- Empty command";
+ else if(ctx->parms[0] == L"status")
cmd_status(os, ctx);
else if(ctx->parms[0] == L"time")
cmd_time(os, ctx);