From: Perttu Ahola Date: Thu, 5 Apr 2012 18:18:42 +0000 (+0300) Subject: Fix crash when inputting only / in chat X-Git-Tag: 0.4.dev-20120408~28 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e74da72b824dfddacfb1c5386721d7094c0b7a94;p=oweals%2Fminetest.git Fix crash when inputting only / in chat --- diff --git a/src/servercommand.cpp b/src/servercommand.cpp index 2c74c81ea..cf89f7f56 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);