Skip to content

Commit

Permalink
Fixed bug truncating last number in label action
Browse files Browse the repository at this point in the history
Thanks to @NiekD

(cherry picked from commit a4b438f)
  • Loading branch information
CurlyMoo committed May 3, 2018
1 parent 2d9ce8f commit de5e002
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/pilight/events/actions/label.c
Expand Up @@ -438,7 +438,7 @@ static void *thread(void *param) {
}
memset(label, '\0', l);
free_label = 1;
snprintf(label, l, "%.*f", jlabel->decimals_, jlabel->number_);
snprintf(label, l + 1, "%.*f", jlabel->decimals_, jlabel->number_);
label[l] = '\0';
}
if((new_label = MALLOC(strlen(label)+1)) == NULL) {
Expand Down

0 comments on commit de5e002

Please sign in to comment.