fix: never use a log message as a format string (#135)

This commit is contained in:
Erik Scholz authored and GitHub committed 2024-01-01 20:43:47 +08:00
1 parent 2e79a82f85
commit 4a5e7b58e2
1 file changed
+3 -3
+3 -3
View File
@@ -460,13 +460,13 @@ void sd_log_cb(enum sd_log_level_t level, const char* log, void* data) {
return; return;
} }
if (level <= SD_LOG_INFO) { if (level <= SD_LOG_INFO) {
fprintf(stdout, log); fputs(log, stdout);
fflush(stdout); fflush(stdout);
} else { } else {
fprintf(stderr, log); fputs(log, stderr);
fflush(stderr); fflush(stderr);
} }
}; }
int main(int argc, const char* argv[]) { int main(int argc, const char* argv[]) {
SDParams params; SDParams params;