diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2024-03-19 21:08:52 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2024-03-20 15:18:21 +0100 |
commit | 6a705f1234919c255cc230403ad6749edabf83be (patch) | |
tree | 325220dfa5cf279a7ce9af3babf04631d90fc2d2 /src/network/networkd-route-nexthop.c | |
parent | basic/string-util: use strdup_to() in string_extract_line() (diff) | |
download | systemd-6a705f1234919c255cc230403ad6749edabf83be.tar.xz systemd-6a705f1234919c255cc230403ad6749edabf83be.zip |
Replace strdup_or_null() by strdup_to()
I didn't know that this helper existed… It is very similar to strdup_to_full(),
but all callers can actually be replaced by strdup_to(), which has more fitting
semantics.
Diffstat (limited to '')
-rw-r--r-- | src/network/networkd-route-nexthop.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/networkd-route-nexthop.c b/src/network/networkd-route-nexthop.c index 8ba7505987..11215c36c7 100644 --- a/src/network/networkd-route-nexthop.c +++ b/src/network/networkd-route-nexthop.c @@ -218,7 +218,7 @@ static int route_nexthop_copy(const RouteNextHop *src, RouteNextHop *dest) { /* unset pointer copied in the above. */ dest->ifname = NULL; - return strdup_or_null(src->ifindex > 0 ? NULL : src->ifname, &dest->ifname); + return strdup_to(&dest->ifname, src->ifindex > 0 ? NULL : src->ifname); } static int route_nexthop_dup(const RouteNextHop *src, RouteNextHop **ret) { |