Fix "make cppcheck" warning.

This commit is contained in:
Dianne Skoll
2025-08-12 18:30:36 -04:00
parent 0976cd64f3
commit cda4877229

View File

@@ -1372,26 +1372,26 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig const *tim, int dse, int is
/* If it's a MSG-type reminder, and no -k option was used, issue the banner. */ /* If it's a MSG-type reminder, and no -k option was used, issue the banner. */
if ((t->typ == MSG_TYPE || t->typ == MSF_TYPE) if ((t->typ == MSG_TYPE || t->typ == MSF_TYPE)
&& !DidMsgReminder && !NextMode && !msg_command && !is_queued) { && !DidMsgReminder && !NextMode && !msg_command && !is_queued) {
DynamicBuffer buf; DynamicBuffer buf2;
DBufInit(&buf); DBufInit(&buf2);
DidMsgReminder = 1; DidMsgReminder = 1;
if (!DoSubstFromString(DBufValue(&Banner), &buf, if (!DoSubstFromString(DBufValue(&Banner), &buf2,
DSEToday, NO_TIME) && DSEToday, NO_TIME) &&
DBufLen(&buf)) { DBufLen(&buf2)) {
if (!JSONMode) { if (!JSONMode) {
printf("%s\n", DBufValue(&buf)); printf("%s\n", DBufValue(&buf2));
} else { } else {
if (JSONLinesEmitted) { if (JSONLinesEmitted) {
printf("},\n"); printf("},\n");
} }
JSONLinesEmitted++; JSONLinesEmitted++;
printf("{\"banner\":\""); printf("{\"banner\":\"");
remove_trailing_newlines(&buf); remove_trailing_newlines(&buf2);
PrintJSONString(DBufValue(&buf)); PrintJSONString(DBufValue(&buf2));
printf("\""); printf("\"");
} }
} }
DBufFree(&buf); DBufFree(&buf2);
} }
/* If it's NextMode, process as a ADVANCE_MODE-type entry, and issue /* If it's NextMode, process as a ADVANCE_MODE-type entry, and issue