diff options
author | Ingo Bürk <admin@airblader.de> | 2018-07-13 15:17:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-13 15:17:51 +0200 |
commit | fc9da67e65819cb14071db4fd5b7941ab01a1134 (patch) | |
tree | 5f6ab7b574e6fad71cdd2d8ac21c19ba0768d936 /src/print_ipv6_addr.c | |
parent | 9aafc38370e5f2b337643d22aa04f4d34208fb03 (diff) | |
parent | 52e9f6f63b74db2a6a1d67524851649b18794950 (diff) |
Merge pull request #297 from Stunkymonkey/percent-first
able to print percentage
Diffstat (limited to 'src/print_ipv6_addr.c')
-rw-r--r-- | src/print_ipv6_addr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/print_ipv6_addr.c b/src/print_ipv6_addr.c index a24119f..a50bf39 100644 --- a/src/print_ipv6_addr.c +++ b/src/print_ipv6_addr.c @@ -133,12 +133,13 @@ void print_ipv6_info(yajl_gen json_gen, char *buffer, const char *format_up, con for (walk = format_up; *walk != '\0'; walk++) { if (*walk != '%') { *(outwalk++) = *walk; - continue; - } - if (BEGINS_WITH(walk + 1, "ip")) { + } else if (BEGINS_WITH(walk + 1, "ip")) { outwalk += sprintf(outwalk, "%s", addr_string); walk += strlen("ip"); + + } else { + *(outwalk++) = '%'; } } END_COLOR; |