mirror of https://github.com/eclipse/paho.mqtt.c
Fix 2 LGTM complaints
This commit is contained in:
parent
2e55df8b82
commit
6b4227d4be
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue