Skip to content

Commit

Permalink
Fix issue #152
Browse files Browse the repository at this point in the history
  • Loading branch information
roleoroleo committed Aug 25, 2023
1 parent 8830172 commit 1276c0f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/mqtt/mqtt-sonoff/src/mqtt-sonoff.c
Original file line number Diff line number Diff line change
Expand Up @@ -739,11 +739,9 @@ static char *print_select_json(char *select_name, char **options, int noptions,
static int json_common(cJSON *confObject, const char **suffix) {

char dname[128];
if (mqtt_sonoff_conf.ha_name_prefix) {
sprintf(dname, "%s %s", mqtt_sonoff_conf.ha_name_prefix, *suffix);
} else {
strcpy(dname, *suffix);
}

strcpy(dname, *suffix);

if (cJSON_AddStringToObject(confObject, "name", dname) == NULL) {
goto end;
}
Expand Down

0 comments on commit 1276c0f

Please sign in to comment.