From: Roy Marples Date: Thu, 28 Mar 2024 16:50:32 +0000 (+0000) Subject: DHCP6: Remove leading space from delegated_dhcp6_prefix X-Git-Tag: v10.0.7~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ab1dfa54ee5a1312446e4bb47cc0220d4e396ab;p=thirdparty%2Fdhcpcd.git DHCP6: Remove leading space from delegated_dhcp6_prefix --- diff --git a/src/dhcp6.c b/src/dhcp6.c index bdc3664e..58ec4eb0 100644 --- a/src/dhcp6.c +++ b/src/dhcp6.c @@ -4254,6 +4254,7 @@ dhcp6_env(FILE *fp, const char *prefix, const struct interface *ifp, #ifndef SMALL const struct dhcp6_state *state; const struct ipv6_addr *ap; + bool first; #endif if (m == NULL) @@ -4355,10 +4356,13 @@ delegated: return 1; if (fprintf(fp, "%s_delegated_dhcp6_prefix=", prefix) == -1) return -1; + first = true; TAILQ_FOREACH(ap, &state->addrs, next) { if (ap->delegating_prefix == NULL) continue; - if (ap != TAILQ_FIRST(&state->addrs)) { + if (first) + first = false; + else { if (fputc(' ', fp) == EOF) return -1; }