diff options
author | Tobias Brunner <tobias@strongswan.org> | 2015-10-07 16:25:05 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2015-11-10 12:13:06 +0100 |
commit | ebeb8c87c5669fa2cd2d2e580e5c731e9d4cc922 (patch) | |
tree | 42538160de09e6b35a3f03c1cafdc933b8336589 /src/libstrongswan/selectors/traffic_selector.c | |
parent | c2967484a0d44a1cb4e4aa323a31a7a48c5b8a03 (diff) | |
download | strongswan-ebeb8c87c5669fa2cd2d2e580e5c731e9d4cc922.tar.bz2 strongswan-ebeb8c87c5669fa2cd2d2e580e5c731e9d4cc922.tar.xz |
traffic-selector: Don't end printf'ed list of traffic selectors with a space
Diffstat (limited to 'src/libstrongswan/selectors/traffic_selector.c')
-rw-r--r-- | src/libstrongswan/selectors/traffic_selector.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libstrongswan/selectors/traffic_selector.c b/src/libstrongswan/selectors/traffic_selector.c index 668632459..a6298b394 100644 --- a/src/libstrongswan/selectors/traffic_selector.c +++ b/src/libstrongswan/selectors/traffic_selector.c @@ -219,9 +219,8 @@ int traffic_selector_printf_hook(printf_hook_data_t *data, enumerator_t *enumerator; char from_str[INET6_ADDRSTRLEN] = ""; char to_str[INET6_ADDRSTRLEN] = ""; - char *serv_proto = NULL; - bool has_proto; - bool has_ports; + char *serv_proto = NULL, *sep = ""; + bool has_proto, has_ports; size_t written = 0; u_int32_t from[4], to[4]; @@ -235,8 +234,8 @@ int traffic_selector_printf_hook(printf_hook_data_t *data, enumerator = list->create_enumerator(list); while (enumerator->enumerate(enumerator, (void**)&this)) { - /* call recursivly */ - written += print_in_hook(data, "%R ", this); + written += print_in_hook(data, "%s%R", sep, this); + sep = " "; } enumerator->destroy(enumerator); return written; |