musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/misc/syslog.c
diff options
context:
space:
mode:
authorJakub Stasiak <jakub@stasiak.at>2024年06月14日 00:59:41 +0200
committerRich Felker <dalias@aerifal.cx>2024年06月22日 17:01:00 -0400
commit947b4574fa7998f027d3906e1f53acb9a7553c61 (patch)
tree3ff1a0ab8e3f77815f98ad255e543638863ffa79 /src/misc/syslog.c
parent50ab830633134dac99011219f0210ee2759ffbde (diff)
downloadmusl-947b4574fa7998f027d3906e1f53acb9a7553c61.tar.gz
inet_ntop: fix the IPv6 leading zero sequence compression
Per RFC 5952, ties for longest sequence of zero fields must be broken by choosing the earliest, but the implementation put the leading sequence of zeros at a disadvantage. That's because for example when compressing "0:0:0:10:0:0:0:10" the strspn(buf+i, ":0") call returns 6 for the first sequence and 7 for the second one – the second sequence has the benefit of a leading colon. Changing the condition to require beating the leading sequence by not one but two characters resolves the issue.
Diffstat (limited to 'src/misc/syslog.c')
0 files changed, 0 insertions, 0 deletions
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月15日 17:42:57 +0000

AltStyle によって変換されたページ (->オリジナル) /