]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: tools: make my_strndup() take a size_t len instead of and int
authorWilly Tarreau <w@1wt.eu>
Wed, 30 Apr 2025 03:15:22 +0000 (05:15 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Apr 2025 03:17:43 +0000 (05:17 +0200)
commit566b384e4e863162f9fbb2a0dd856e03fe305b90
tree855968f4340947338710340d9b5563d4ebb880bf
parent5f9ce99c799eaa8f58518201b58c32d970b10cdf
MINOR: tools: make my_strndup() take a size_t len instead of and int

In relation to issue #2954, it appears that turning some size_t length
calculations to the int that uses my_strndup() upsets coverity a bit.
Instead of dealing with such warnings each time, better address it at
the root. An inspection of all call places show that the size passed
there is always positive so we can safely use an unsigned type, and
size_t will always suit it like for strndup() where it's available.
include/haproxy/tools.h
src/tools.c