From: Miroslav Lichvar Date: Thu, 20 Mar 2025 14:20:46 +0000 (+0100) Subject: conf: switch other_parse_error() to variable arguments X-Git-Tag: 4.7-pre1~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2b127b2e93f20f3b10fbb5dccb36fb18d5b5199b;p=thirdparty%2Fchrony.git conf: switch other_parse_error() to variable arguments --- diff --git a/conf.c b/conf.c index fe202a48..8b468f1a 100644 --- a/conf.c +++ b/conf.c @@ -363,12 +363,20 @@ command_parse_error(void) /* ================================================== */ +FORMAT_ATTRIBUTE_PRINTF(1, 2) static void -other_parse_error(const char *message) +other_parse_error(const char *format, ...) { - LOG_FATAL("%s at line %d%s%s", - message, line_number, processed_file ? " in file " : "", - processed_file ? processed_file : ""); + char buf[256]; + va_list ap; + + va_start(ap, format); + vsnprintf(buf, sizeof (buf), format, ap); + va_end(ap); + + LOG_FATAL("%s at line %d%s%s", + buf, line_number, processed_file ? " in file " : "", + processed_file ? processed_file : ""); } /* ================================================== */