]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/http: replace strchrnul for mac os compatibility
authorTomas Krizek <tomas.krizek@nic.cz>
Fri, 2 Oct 2020 08:43:15 +0000 (10:43 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 13 Oct 2020 10:55:30 +0000 (12:55 +0200)
strchrnul() is a GNU extension that is not available on Mac OS.

daemon/http.c

index a39d346a7060d20af00c813fbe0008409a7214b0..e746bb1eb61fb736eab6bd4aa16fa5c8cd8bd0fb 100644 (file)
@@ -146,7 +146,10 @@ static int process_uri_path(struct http_ctx *ctx, const char* path, int32_t stre
                return 0;
 
        beg += sizeof(key) - 1;
-       end = strchrnul(beg, '&');
+       end = strchr(beg, '&');
+       if (end == NULL)
+               end = beg + strlen(beg);
+
        ctx->buf_pos = sizeof(uint16_t);  /* Reserve 2B for dnsmsg len. */
        remaining = ctx->buf_size - ctx->submitted - ctx->buf_pos;
        dest = ctx->buf + ctx->buf_pos;