Fix of warning: comparison between signed and unsigned integer
expressions 


Set a null string to the client ID when it of CONNECT is empty.

Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
tomoaki
2017-09-21 15:59:40 +09:00
committed by tomoaki
parent 98c1ebae50
commit 4935d2aa86
8 changed files with 26 additions and 9 deletions

View File

@@ -227,6 +227,16 @@ Client* ClientList::createClient(SensorNetAddress* addr, MQTTSNString* clientId,
{
client->setClientId(*clientId);
}
else
{
MQTTSNString dummyId;
char* id = (char*)malloc(1);
*id = 0;
dummyId.cstring = id;
dummyId.lenstring.len = 0;
client->setClientId(dummyId);
free(id);
}
/* add the list */
if ( _firstClient == 0 )