]> 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>
Wed, 25 Dec 2024 13:41:54 +0000 (14:41 +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 b72778fcb7750b93e99f70361428e0e2ce41bfc1..c2fdf3722f4dc41b57fe3ebc63fc980aa6f01fb4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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-08  Bruno Haible  <bruno@clisp.org>
 
        Update dependencies of modules that include "gettext.h".
index 959c77d0a0814b20fa877a8ce8f70b9038499cca..d50021b80fca527a1e771d7b426532d2d70f365f 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