X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal%2Fmicrohttpd-util.c;fp=src%2Fjournal%2Fmicrohttpd-util.c;h=3844f7a03c5e477e514883afdcde7e33a678ac98;hb=bcfce235a3d757f0ec3b0c01e8583382db1adfe2;hp=c45d0df722c0d708bfd8338232bd9634364182ab;hpb=beb999379ced9e8d765e533e43d35aab11aa5c39;p=elogind.git diff --git a/src/journal/microhttpd-util.c b/src/journal/microhttpd-util.c index c45d0df72..3844f7a03 100644 --- a/src/journal/microhttpd-util.c +++ b/src/journal/microhttpd-util.c @@ -27,14 +27,15 @@ #include "macro.h" #include "util.h" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" void microhttpd_logger(void *arg, const char *fmt, va_list ap) { - _cleanup_free_ char *f; + _cleanup_free_ char *f = NULL; + if (asprintf(&f, "microhttpd: %s", fmt) <= 0) { log_oom(); return; } + + DISABLE_WARNING_FORMAT_NONLITERAL; log_metav(LOG_INFO, NULL, 0, NULL, f, ap); + REENABLE_WARNING; } -#pragma GCC diagnostic pop