//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
//
// no Data received
//////////////////////////////////////////////////
if (bytes <= 0) {
- if (errno != EAGAIN)
+ if (errno != EAGAIN && errno != 0) // MSVC output "NoError" otherwise
perror("FGMultiplayMgr::MP_ProcessData");
break;
}
return;
}
- char MsgBuf[MsgHdr->MsgLen - sizeof(T_MsgHdr)];
+ char *MsgBuf = new char[MsgHdr->MsgLen - sizeof(T_MsgHdr)];
strncpy(MsgBuf, ((T_ChatMsg *)(Msg + sizeof(T_MsgHdr)))->Text,
MsgHdr->MsgLen - sizeof(T_MsgHdr));
MsgBuf[MsgHdr->MsgLen - sizeof(T_MsgHdr) - 1] = '\0';
T_ChatMsg* ChatMsg = (T_ChatMsg *)(Msg + sizeof(T_MsgHdr));
SG_LOG ( SG_NETWORK, SG_ALERT, "Chat [" << MsgHdr->Callsign << "]"
<< " " << MsgBuf << endl);
+ delete [] MsgBuf;
} // FGMultiplayMgr::ProcessChatMsg ()
//////////////////////////////////////////////////////////////////////