]> 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 14:30:53 +0000 (15:30 +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 14107403981a9033c4cdafeb16c660afef44ec83..2ec6b3b487813fc6a60a52c69087298abc7098bb 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