]> eyrie.org Git - kerberos/krb5-strength.git/blobdiff - plugin/error.c
Declare fast forward from 3.1-2
[kerberos/krb5-strength.git] / plugin / error.c
index 9fc0422d14d2a95a1222526e6ead71bd03b775cc..4c6541c76d19460b1266b8c513bc965c347cc706 100644 (file)
@@ -5,10 +5,11 @@
  * message in the Kerberos context.
  *
  * Written by Russ Allbery <eagle@eyrie.org>
+ * Copyright 2016 Russ Allbery <eagle@eyrie.org>
  * Copyright 2013
  *     The Board of Trustees of the Leland Stanford Junior University
  *
- * See LICENSE for licensing terms.
+ * SPDX-License-Identifier: MIT
  */
 
 #include <config.h>
@@ -25,7 +26,7 @@
  * Internal helper function to set the Kerberos error message given a format,
  * an error code, and a variable argument structure.
  */
-static void
+static void __attribute__((__format__(printf, 3, 0)))
 set_error(krb5_context ctx, krb5_error_code code, const char *format,
           va_list args)
 {
@@ -49,20 +50,20 @@ set_error(krb5_context ctx, krb5_error_code code, const char *format,
  * and variable arguments and set the Kerberos error code and message,
  * returning the appropriate code.
  */
-#define ERROR_FUNC(name, code)                                          \
-    krb5_error_code                                                     \
-    strength_error_ ## name(krb5_context ctx, const char *format, ...)  \
-    {                                                                   \
-        va_list args;                                                   \
-        va_start(args, format);                                         \
-        set_error(ctx, code, format, args);                             \
-        va_end(args);                                                   \
-        return code;                                                    \
+#define ERROR_FUNC(name, code)                                     \
+    krb5_error_code strength_error_##name(krb5_context ctx,        \
+                                          const char *format, ...) \
+    {                                                              \
+        va_list args;                                              \
+        va_start(args, format);                                    \
+        set_error(ctx, code, format, args);                        \
+        va_end(args);                                              \
+        return code;                                               \
     }
-ERROR_FUNC(class,    KADM5_PASS_Q_CLASS)
-ERROR_FUNC(config,   KADM5_MISSING_KRB5_CONF_PARAMS)
-ERROR_FUNC(dict,     KADM5_PASS_Q_DICT)
-ERROR_FUNC(generic,  KADM5_PASS_Q_GENERIC)
+ERROR_FUNC(class, KADM5_PASS_Q_CLASS)
+ERROR_FUNC(config, KADM5_MISSING_KRB5_CONF_PARAMS)
+ERROR_FUNC(dict, KADM5_PASS_Q_DICT)
+ERROR_FUNC(generic, KADM5_PASS_Q_GENERIC)
 ERROR_FUNC(tooshort, KADM5_PASS_Q_TOOSHORT)