]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/http nit: silence a warning
authorVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 24 Aug 2022 09:50:14 +0000 (11:50 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 24 Aug 2022 10:00:39 +0000 (12:00 +0200)
Enums are more like ints anyway (in standard),
even when drawn from a small subset.

daemon/http.c

index 421d5b4032b26f13d5ebcd0548986c78f75cb9c3..af387d818cb2027a3623f094452d1757f47a4914 100644 (file)
@@ -778,7 +778,7 @@ static int http_send_response(struct http_ctx *ctx, int32_t stream_id,
        if (likely(status == HTTP_STATUS_OK)) {
                push_nv(&hdrs, MAKE_STATIC_NV(":status", "200"));
        } else {
-               int status_len = asprintf(&status_str, "%" PRIu16, status);
+               int status_len = asprintf(&status_str, "%d", (int)status);
                kr_require(status_len >= 0);
                push_nv(&hdrs, MAKE_STATIC_KEY_NV(":status", status_str, status_len));
        }