summaryrefslogtreecommitdiffstats
path: root/src/vlib/stats/format.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib/stats/format.c')
-rw-r--r--src/vlib/stats/format.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/vlib/stats/format.c b/src/vlib/stats/format.c
index 419ff6b4657..54c11aff743 100644
--- a/src/vlib/stats/format.c
+++ b/src/vlib/stats/format.c
@@ -9,16 +9,13 @@
u8 *
format_vlib_stats_symlink (u8 *s, va_list *args)
{
- char *input = va_arg (*args, char *);
- char *modified_input = vec_dup (input);
- int i;
- u8 *result;
+ u8 *input = va_arg (*args, u8 *);
- for (i = 0; i < strlen (modified_input); i++)
- if (modified_input[i] == '/')
- modified_input[i] = '_';
+ for (int i = 0; i < vec_len (input); i++)
+ if (input[i] == '/')
+ vec_add1 (s, '_');
+ else
+ vec_add1 (s, input[i]);
- result = format (s, "%s", modified_input);
- vec_free (modified_input);
- return result;
+ return s;
}