Skip to content

Commit f5b710b

Browse files
committed
drivers/dstate.c: do not add whitespace on lone alarm [networkupstools#2931]
Signed-off-by: desertwitch <[email protected]>
1 parent 73a8006 commit f5b710b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/dstate.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1842,7 +1842,11 @@ void status_commit(void)
18421842
}
18431843

18441844
if (alarm_active || alarm_legacy_status) {
1845-
dstate_setinfo("ups.status", "ALARM %s", status_buf);
1845+
if (*status_buf != '\0') {
1846+
dstate_setinfo("ups.status", "ALARM %s", status_buf);
1847+
} else {
1848+
dstate_setinfo("ups.status", "ALARM");
1849+
}
18461850
} else {
18471851
dstate_setinfo("ups.status", "%s", status_buf);
18481852
alarm_legacy_status = 0; /* just to be sure */

0 commit comments

Comments
 (0)