[Positioner] EvAAL: do not send \0

The NULL character must not be sent at the end of the result string, or
the Socket Server behaves weirdly.
This commit is contained in:
Matteo Cypriani 2012-07-10 16:15:45 +02:00
parent 307da87760
commit f6fa26507f
1 changed files with 3 additions and 1 deletions

View File

@ -135,7 +135,9 @@ area_of_interest_number(const Point3D &position) const
*/
bool OutputTCPSocketEvAAL::send_data(const string &data) const
{
unsigned int data_len = data.size() + 1 ; // +1 for the '\0'
// Do *not* add one extra character for the '\0', it must not be sent!
unsigned int data_len = data.size() ;
ssize_t nsent = send(sockfd, data.c_str(), data_len, 0) ;
if (nsent != static_cast<ssize_t>(data_len))
{