summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-route-nexthop.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2024-03-19 21:08:52 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2024-03-20 15:18:21 +0100
commit6a705f1234919c255cc230403ad6749edabf83be (patch)
tree325220dfa5cf279a7ce9af3babf04631d90fc2d2 /src/network/networkd-route-nexthop.c
parentbasic/string-util: use strdup_to() in string_extract_line() (diff)
downloadsystemd-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.c2
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) {