]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CLEANUP: opentracing: remove the last two occurrences of strncat()
authorWilly Tarreau <w@1wt.eu>
Fri, 7 Apr 2023 13:38:58 +0000 (15:38 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 7 Apr 2023 16:14:28 +0000 (18:14 +0200)
commitad44939e402554c4a5775c3192614cb474180d28
tree6569f71750d3a809042f84ba0e6f08a6905ebaec
parentfc458ec8aaa488d9abbc4cdc7240d65cfbb0ae28
CLEANUP: opentracing: remove the last two occurrences of strncat()

In flt_ot_sample_to_str() there were two occurrences of strncat() which
are used to copy N chars from the source and append a zero. For the sake
of definitely getting rid of this nasty function let's replace them by
memcpy() instead. It's worth noting that the length test there appeared
to be incorrect as it didn't make provisions for the trailing zero,
unless the size argument doesn't take it into account (seems unlikely).
Nothing was changed regarding this. If the code was good, it still is,
otherwise if it was bad it still is. At least this is more obvious now
than when using a function that needs n+1 chars to work.
addons/ot/src/util.c