# HG changeset patch # User paul # Date 2015-04-13 05:48:33 # Node ID 02c08ecbd061df6f9cea9b3f7555d3043687bf65 # Parent 18e6fd22aa86820e97c9933323aef25eaccc354c corrected: bug on the telecommand size calculation diff --git a/spwplugin/SpwTcpPacketServer/spwtcppacketserver.cpp b/spwplugin/SpwTcpPacketServer/spwtcppacketserver.cpp --- a/spwplugin/SpwTcpPacketServer/spwtcppacketserver.cpp +++ b/spwplugin/SpwTcpPacketServer/spwtcppacketserver.cpp @@ -157,7 +157,9 @@ void SpwTcpPacketServer::sendSPWPacketUs onePacketReceived(); if(data[0]==(char)0) // Protocole = 0 => Host to SpaceWire packet transmission { - int size = (data[1]*256*256) + (data[2]*256) + data[3]; + int size = ( (unsigned char) data[1] ) * 256 * 256 + + ( (unsigned char) data[2] ) * 256 + + (unsigned char) data[3]; char* SPWpacket = (char*)malloc(size); memcpy(SPWpacket,data.data()+4,size); // 4 bytes will be added later to the packet emit sendSPWPacket(SPWpacket,size);