From cf2553033f08c9dfc2a5d6eaf59a57b739a512e0 Mon Sep 17 00:00:00 2001 From: Colin Date: Sun, 1 Jun 2025 20:20:19 +0000 Subject: [PATCH] fix missing printf specifiers fixes these warnings: > ../src/main.c: In function 'capture_completed': > ../src/main.c:321:9: error: format not a string literal and no format arguments -Werror=format-security > 321 | snprintf(last_path, sizeof(last_path), args->fname); > | ^~~~~~~~ > ../src/process_pipeline.c: In function 'setup_capture': > ../src/process_pipeline.c:165:9: error: format not a string literal and no format arguments [-Werror=format-security] > 165 | snprintf(burst_dir, sizeof(burst_dir), tempdir); > | ^~~~~~~~ otherwise, `args->fname` and `tempdir` themself would be interpreted as the specifier. --- src/main.c | 2 +- src/process_pipeline.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 75fd301..811f549 100644 --- a/src/main.c +++ b/src/main.c @@ -318,7 +318,7 @@ struct capture_completed_args { static bool capture_completed(struct capture_completed_args *args) { - snprintf(last_path, sizeof(last_path), args->fname); + snprintf(last_path, sizeof(last_path), "%s", args->fname); gtk_image_set_from_paintable(GTK_IMAGE(thumb_last), GDK_PAINTABLE(args->thumb)); diff --git a/src/process_pipeline.c b/src/process_pipeline.c index a913129..7113a2f 100644 --- a/src/process_pipeline.c +++ b/src/process_pipeline.c @@ -162,7 +162,7 @@ static void setup_capture(void) exit(EXIT_FAILURE); } - snprintf(burst_dir, sizeof(burst_dir), tempdir); + snprintf(burst_dir, sizeof(burst_dir), "%s", tempdir); } static void