From 92f39fe2c373f9a34fe839542a8c3f79e7ff2ef7 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Thu, 13 Nov 2008 00:54:22 +0300 Subject: [PATCH] Better args checking in .sendmoney command. --- src/game/Level3.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 54b307d5c..8d7e412c2 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -6324,7 +6324,8 @@ bool ChatHandler::HandleSendMoneyCommand(const char* args) if (!msgText) return false; - int32 money = atoi(strtok(NULL, "")); + char* money_str = strtok(NULL, ""); + int32 money = money_str ? atoi(money_str) : 0; if (money <= 0) return false;