Fix bug on Mac M1 with redis chat example code (#1566)
This commit is contained in:
parent
65b1715539
commit
7c96c7fbf5
|
@ -80,7 +80,7 @@ void Chat::handleNewMessage(const WebSocketConnectionPtr& wsConnPtr,
|
|||
std::string room;
|
||||
if (message.compare(0, 6, "ENTER ") == 0)
|
||||
{
|
||||
room = message.substr(6);
|
||||
room = message.substr(6, message.find_last_not_of(" \n") - 5);
|
||||
if (!checkRoomNumber(room))
|
||||
{
|
||||
wsConnPtr->send("ERROR: Invalid room number, should be [0-99].");
|
||||
|
|
Loading…
Reference in New Issue