From: Tomas Krizek Date: Fri, 2 Oct 2020 08:43:15 +0000 (+0200) Subject: daemon/http: replace strchrnul for mac os compatibility X-Git-Tag: v5.2.0~15^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=280cfbdfcdc7c221f0d161c7fdcda624d3a52ebe;p=thirdparty%2Fknot-resolver.git daemon/http: replace strchrnul for mac os compatibility strchrnul() is a GNU extension that is not available on Mac OS. --- diff --git a/daemon/http.c b/daemon/http.c index a39d346a7..e746bb1eb 100644 --- a/daemon/http.c +++ b/daemon/http.c @@ -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;