Fix JSON error

Fix JSON error (#4108)
This commit is contained in:
Theo Arends 2018-10-19 18:16:53 +02:00
parent a37848dbef
commit 22ecc8f618
1 changed files with 1 additions and 1 deletions

View File

@ -365,7 +365,7 @@ void Mpr121Show(struct mpr121 *pS, byte function)
// Append JSON message string
if (FUNC_JSON_APPEND == function) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s\"Button%i\":%i,"), mqtt_data, j, BITC(i, j));
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s%s\"Button%i\":%i"), mqtt_data, (i > 0 ? "," : ""), j, BITC(i, j));
}
} // for-loop j