From 0108d8b54b75c1bf354ee3e4fdce0168996d93a1 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 10 Dec 2024 21:19:17 +0100 Subject: [PATCH] openat-die: Fix a gcc -Wformat -Wformat-security warning. * lib/openat-die.c (openat_save_fail, openat_restore_fail): Put the internationalized error message into non-format-string position. --- ChangeLog | 6 ++++++ lib/openat-die.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b72778fcb7..c2fdf3722f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-12-10 Bruno Haible + + openat-die: Fix a gcc -Wformat -Wformat-security warning. + * lib/openat-die.c (openat_save_fail, openat_restore_fail): Put the + internationalized error message into non-format-string position. + 2024-12-08 Bruno Haible Update dependencies of modules that include "gettext.h". diff --git a/lib/openat-die.c b/lib/openat-die.c index 959c77d0a0..d50021b80f 100644 --- a/lib/openat-die.c +++ b/lib/openat-die.c @@ -34,7 +34,7 @@ _Noreturn void openat_save_fail (int errnum) { #ifndef GNULIB_LIBPOSIX - error (exit_failure, errnum, + error (exit_failure, errnum, "%s", _("unable to record current working directory")); #endif /* _Noreturn cannot be applied to error, since it returns @@ -53,7 +53,7 @@ _Noreturn void openat_restore_fail (int errnum) { #ifndef GNULIB_LIBPOSIX - error (exit_failure, errnum, + error (exit_failure, errnum, "%s", _("failed to return to initial working directory")); #endif -- 2.39.5