]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD: log: get rid of non-portable strnlen() func
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 17 May 2024 08:24:33 +0000 (10:24 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Fri, 17 May 2024 13:24:53 +0000 (15:24 +0200)
commite84c8dee1a033627e4a5f7d63ae6a9dfcdcc77dd
tree3e4e0c04666a5bb93503d0d1fb02f18c1724790f
parentf18ed8d07e829aec217df6b1736dffe087ca29ba
BUILD: log: get rid of non-portable strnlen() func

In c614fd3b9 ("MINOR: log: add +cbor encoding option"), I wrongly used
strnlen() without noticing that the function is not portable (requires
_POSIX_C_SOURCE >= 2008) and that it was the first occurrence in the
entire project. In fact it is not a hard requirement since it's a pretty
simple function. Thus to restore build compatibility with minimal/older
build systems, let's actually get rid of it and use an equivalent portable
code where needed (we cannot simply rely on strlen() because the string
might not be NULL terminated, we must take upstream len into account).

No backport needed (unless c614fd3b9 gets backported)
src/log.c