mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-26 15:02:56 +02:00
basicserver.cpp and zapitclient.cpp 2.try to fix compiler warnings, suggested by Seife
This commit is contained in:
@@ -132,7 +132,7 @@ bool CBasicServer::parse(bool (parse_command)(CBasicMessage::Header &rmsg, int c
|
||||
memset(&rmsg, 0, sizeof(rmsg));
|
||||
ssize_t r = read(conn_fd, &rmsg, sizeof(rmsg));
|
||||
|
||||
if (r && rmsg.version == version)
|
||||
if (r == sizeof(rmsg) && rmsg.version == version)
|
||||
parse_another_command = parse_command(rmsg, conn_fd);
|
||||
else
|
||||
printf("[%s] Command ignored: cmd %x version %d received - server cmd version is %d\n", name.c_str(), rmsg.cmd, rmsg.version, version);
|
||||
|
@@ -381,7 +381,7 @@ void CZapitClient::zaptoNvodSubService(const int num)
|
||||
/* bouquets are numbered starting at 0 */
|
||||
void CZapitClient::getBouquets(BouquetList& bouquets, const bool emptyBouquetsToo, const bool utf_encoded, channelsMode mode)
|
||||
{
|
||||
char buffer[30 + 1];
|
||||
char buffer[30];
|
||||
|
||||
CZapitMessages::commandGetBouquets msg;
|
||||
VALGRIND_PARANOIA;
|
||||
@@ -400,9 +400,8 @@ void CZapitClient::getBouquets(BouquetList& bouquets, const bool emptyBouquetsTo
|
||||
|
||||
if (!utf_encoded)
|
||||
{
|
||||
buffer[30] = (char) 0x00;
|
||||
strncpy(buffer, response.name, sizeof(buffer)-1);
|
||||
snprintf(response.name,sizeof(buffer)-1,"%s",ZapitTools::UTF8_to_Latin1(buffer).c_str());
|
||||
strncpy(buffer, response.name, sizeof(buffer));
|
||||
snprintf(response.name,sizeof(buffer),"%s",ZapitTools::UTF8_to_Latin1(buffer).c_str());
|
||||
}
|
||||
bouquets.push_back(response);
|
||||
}
|
||||
|
Reference in New Issue
Block a user