]> git.ipfire.org Git - thirdparty/systemd.git/commit
networkd-util: Avoid call to endswith()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 14 May 2025 19:41:43 +0000 (21:41 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 14 May 2025 20:33:45 +0000 (22:33 +0200)
commit08fd159db11b5e580df8e1d227899c884db486d8
treea45be6e40c40f77a30dde12591c047303b8fc149
parent74acb358c54ea2d5006e5f1bd1448e7340e525e0
networkd-util: Avoid call to endswith()

Instead of recalculating the length of the string again after
reading it, let's make sd_netlink_message_read_string() return the
length of the string that we then use to check if the last character
is a dot or not.

This allows us to get rid of the string-util.h include in #37344.
src/libsystemd/sd-netlink/netlink-message.c
src/network/networkd-util.h