Skip to content

Commit

Permalink
Zero byte instead of zero integer
Browse files Browse the repository at this point in the history
This is a really good suggestion from @WSchimi in #6 
Thanks!
  • Loading branch information
pinae authored Nov 26, 2021
1 parent 2e03894 commit e2e232a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ char* createFullTopicStr(const char* topic) {
strncpy(fullTopicStr, deviceName, strlen(deviceName));
strncpy(fullTopicStr+strlen(deviceName), "/", 1);
strncpy(fullTopicStr+strlen(deviceName)+1, topic, strlen(topic));
*(fullTopicStr + topicLen+1) = \0;
*(fullTopicStr + topicLen+1) = '\0';
return fullTopicStr;
}

Expand Down

0 comments on commit e2e232a

Please sign in to comment.