Use function format attribute where applicable

Allow the compiler to verify the format string against the supplied
arguments.

    chage.c:239:51: warning: format not a string literal, format string not checked [-Wformat-nonliteral]
      239 |                 (void) strftime (buf, sizeof buf, format, tp);
          |                                                   ^~~~~~
This commit is contained in:
Christian Göttsche authored and Serge Hallyn committed 2022-08-06 11:27:56 -05:00
1 parent 477c8e6f42
commit c6c8130db4
5 files changed
+7 -11

No files matched your search

+2 -1
View File
@@ -91,7 +91,8 @@ static int fchown_if_needed (int fdst, const struct stat *statp,
/*
* error_acl - format the error messages for the ACL and EQ libraries.
*/
static void error_acl (struct error_context *ctx, const char *fmt, ...)
format_attr(printf, 2, 3)
static void error_acl (unused struct error_context *ctx, const char *fmt, ...)
{
va_list ap;
FILE *shadow_logfd = log_get_logfd();