From 16e7d06083bbcd3d8282f4b462c6615e253ccaf3 Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Sun, 19 May 2019 11:12:17 +0100 Subject: [PATCH] Fix up error logging in game_mode_resolve_wine_preloader() proc_path was never set to non-null but used for error logging, this triggered -Wformat-overflow warnings on GCC 9. Use the pid instead and remove that variable. --- daemon/gamemode-wine.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/daemon/gamemode-wine.c b/daemon/gamemode-wine.c index b6f945c..608a97d 100644 --- a/daemon/gamemode-wine.c +++ b/daemon/gamemode-wine.c @@ -64,7 +64,7 @@ bool game_mode_detect_wine_loader(const char *exe) char *game_mode_resolve_wine_preloader(const pid_t pid) { char buffer[PATH_MAX]; - char *proc_path = NULL, *wine_exe = NULL, *wineprefix = NULL; + char *wine_exe = NULL, *wineprefix = NULL; /* Open the directory, we are potentially reading multiple files from it */ procfd_t proc_fd = game_mode_open_proc(pid); @@ -143,7 +143,6 @@ char *game_mode_resolve_wine_preloader(const pid_t pid) error_cleanup: game_mode_close_proc(proc_fd); free(wineprefix); - free(proc_path); return wine_exe; fail: @@ -155,10 +154,10 @@ fail_cmdline: goto error_cleanup; fail_env: - LOG_ERROR("Failed to access process environment in '%s': %s\n", proc_path, strerror(errno)); + LOG_ERROR("Failed to access process environment for client %d: %s\n", pid, strerror(errno)); goto error_cleanup; fail_proc: - LOG_ERROR("Failed to access process data in '%s': %s\n", proc_path, strerror(errno)); + LOG_ERROR("Failed to access process data for client %d: %s\n", pid, strerror(errno)); goto error_cleanup; }