From: Andy D. <kha...@us...> - 2004-03-30 19:22:30
|
Update of /cvsroot/planeshift/planeshift/src/client/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3312/src/client/gui Modified Files: chatwindow.cpp Log Message: Clarified the error message a bit Index: chatwindow.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/gui/chatwindow.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** chatwindow.cpp 29 Mar 2004 22:47:50 -0000 1.17 --- chatwindow.cpp 30 Mar 2004 19:10:45 -0000 1.18 *************** *** 163,168 **** size_t pos; pos = csString(buff).FindFirst(' '); ! if(*(buff+pos+1) == '\0') ! return "Can't send empty chat string!"; if ( !strncmp(buff+1, "say ", 4)) --- 163,171 ---- size_t pos; pos = csString(buff).FindFirst(' '); ! if(pos == -1 || *(buff+pos+1) == '\0') ! { ! delete [] buff; ! return windowManager->Translate("Can't send empty chat string!").Detach(); ! } if ( !strncmp(buff+1, "say ", 4)) *************** *** 203,208 **** pPerson = buff + 6; pText = strchr(buff+6, ' ' ); ! if ( !pText ) ! pText = ""; else { --- 206,214 ---- pPerson = buff + 6; pText = strchr(buff+6, ' ' ); ! if ( !pText ) ! { ! delete [] buff; ! return windowManager->Translate("Can't send empty chat string!").Detach(); ! } else { *************** *** 228,236 **** chattype = CHAT_ME; } - else - { - delete[] buff; - return windowManager->Translate("Unknown command").Detach(); - } } psChatMessage chat(0, pPerson, pText, chattype, false); --- 234,237 ---- |