summaryrefslogtreecommitdiff
path: root/src/print_eth_info.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/print_eth_info.c')
-rw-r--r--src/print_eth_info.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/print_eth_info.c b/src/print_eth_info.c
index 996ce3b..2fc25a1 100644
--- a/src/print_eth_info.c
+++ b/src/print_eth_info.c
@@ -175,15 +175,17 @@ void print_eth_info(yajl_gen json_gen, char *buffer, const char *interface, cons
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", ip_address);
walk += strlen("ip");
+
} else if (BEGINS_WITH(walk + 1, "speed")) {
outwalk += print_eth_speed(outwalk, interface);
walk += strlen("speed");
+
+ } else {
+ *(outwalk++) = '%';
}
}