ipcalc: fix a double slash for IPv6 in olsr_ip_prefix_to_string
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 29 Apr 2015 16:52:01 +0000 (18:52 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 30 Apr 2015 21:52:25 +0000 (23:52 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/ipcalc.c

index 7280f26..9d3112b 100644 (file)
@@ -177,7 +177,7 @@ olsr_ip_prefix_to_string(const struct olsr_ip_prefix *prefix)
     rv = inet_ntop(AF_INET6, &prefix->prefix.v6, buf, sizeof(buf));
     len = strlen(buf);
     buf[len++] = '/';
-    snprintf(buf + len, sizeof(buf) - len, "/%d", prefix->prefix_len);
+    snprintf(buf + len, sizeof(buf) - len, "%d", prefix->prefix_len);
   }
   return rv;
 }