Fix 2 LGTM complaints

This commit is contained in:
Ian Craggs 2018-09-10 12:33:54 +01:00
parent 2e55df8b82
commit 6b4227d4be
2 changed files with 2 additions and 2 deletions

View File

@ -579,7 +579,7 @@ int MQTTProtocol_handlePubcomps(void* pack, int sock)
(m->MQTTVersion >= MQTTVERSION_5) ? PERSISTENCE_V5_PUBLISH_SENT : PERSISTENCE_PUBLISH_SENT,
m->qos, pubcomp->msgId);
if (rc != 0)
Log(LOG_ERROR, -1, "Error removing PUBCOMP msgid id %d from persistence", client->clientID, pubcomp->msgId);
Log(LOG_ERROR, -1, "Error removing PUBCOMP for client id %s msgid %d from persistence", client->clientID, pubcomp->msgId);
#endif
MQTTProtocol_removePublication(m->publish);
if (m->MQTTVersion >= MQTTVERSION_5)

View File

@ -80,7 +80,7 @@ char* FindString(char* filename, const char* eyecatcher_input)
if ((infile = fopen(filename, "rb")) != NULL)
{
size_t buflen = strlen(eyecatcher);
char* buffer = (char*) malloc(buflen); /* lgtm [cpp/no-space-for-terminator] */
char* buffer = (char*) malloc(buflen + 1); /* added space for unused null terminator to stop LGTM complaint */
if (buffer != NULL)
{