mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-18 01:14:38 +00:00
CLEANUP: log: use strnlen2() in _lf_text_len() to compute string length
Thanks to previous commit, we can now use strnlen2() function to perform strnlen() portable equivalent instead of re-implementing the logic under _lf_text_len() function.
This commit is contained in:
parent
24131dee30
commit
6d5b32daad
10
src/log.c
10
src/log.c
@ -2388,15 +2388,7 @@ static inline char *_lf_text_len(char *dst, const char *src,
|
||||
* indefinite length text in cbor, because indefinite-length text
|
||||
* has to be made of multiple chunks of known size as per RFC8949...
|
||||
*/
|
||||
{
|
||||
int _len;
|
||||
|
||||
/* strnlen(src, len) portable equivalent: */
|
||||
for (_len = 0; _len < len && src[_len]; _len++)
|
||||
;
|
||||
|
||||
len = _len;
|
||||
}
|
||||
len = strnlen2(src, len);
|
||||
|
||||
ret = cbor_encode_text(&ctx->encode.cbor, dst, dst + size, src, len);
|
||||
if (ret == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user