Skip to content

Commit 4a5e7b5

Browse files
authored
fix: never use a log message as a format string (leejet#135)
1 parent 2e79a82 commit 4a5e7b5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/cli/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,13 +460,13 @@ void sd_log_cb(enum sd_log_level_t level, const char* log, void* data) {
460460
return;
461461
}
462462
if (level <= SD_LOG_INFO) {
463-
fprintf(stdout, log);
463+
fputs(log, stdout);
464464
fflush(stdout);
465465
} else {
466-
fprintf(stderr, log);
466+
fputs(log, stderr);
467467
fflush(stderr);
468468
}
469-
};
469+
}
470470

471471
int main(int argc, const char* argv[]) {
472472
SDParams params;

0 commit comments

Comments
 (0)