From: Perttu Ahola Date: Thu, 5 Apr 2012 18:18:42 +0000 (+0300) Subject: Fix crash when inputting only / in chat X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=e74da72b824dfddacfb1c5386721d7094c0b7a94;p=zefram%2Fminetest%2Fminetest_engine.git Fix crash when inputting only / in chat --- diff --git a/src/servercommand.cpp b/src/servercommand.cpp index 2c74c81e..cf89f7f5 100644 --- 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<parms[0] == L"status") cmd_status(os, ctx); else if(ctx->parms[0] == L"time") cmd_time(os, ctx);