]> Savannah Git Hosting - gnulib.git/commitdiff
openat-die: Fix a gcc -Wformat -Wformat-security warning.
authorBruno Haible <bruno@clisp.org>
Tue, 10 Dec 2024 20:19:17 +0000 (21:19 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 10 Dec 2024 21:11:51 +0000 (22:11 +0100)
* lib/openat-die.c (openat_save_fail, openat_restore_fail): Put the
internationalized error message into non-format-string position.

ChangeLog
lib/openat-die.c

index 5bfb71b28d324912373e1379f3167050cfc1a23f..f558a22d4d55457c240ef54f646c1898966cb571 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
-2024-05-12  Simon Josefsson  <simon@josefsson.org>
+2024-12-10  Bruno Haible  <bruno@clisp.org>
+
+       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-10  Simon Josefsson  <simon@josefsson.org>
 
        announce-gen: Mention git commit and tag in announcement.
        * build-aux/announce-gen (this_commit_hash): New variable.
index 403ca4ff7c3bbc20c22b81ac9c19174205731c10..022109b433e33e996c9707be6c7757ab65c2965a 100644 (file)
@@ -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