From: Bruno Haible Date: Tue, 10 Dec 2024 20:19:17 +0000 (+0100) Subject: openat-die: Fix a gcc -Wformat -Wformat-security warning. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=8e03a8c1ca7ccacc4012e18699330cb67b7947c2;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 1410740398..2ec6b3b487 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