summaryrefslogtreecommitdiff
path: root/tools/bpf/bpftool/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/bpf/bpftool/main.c')
-rw-r--r--tools/bpf/bpftool/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/bpf/bpftool/main.c b/tools/bpf/bpftool/main.c
index e02d00d6e00b..8662199ee050 100644
--- a/tools/bpf/bpftool/main.c
+++ b/tools/bpf/bpftool/main.c
@@ -100,7 +100,7 @@ bool is_prefix(const char *pfx, const char *str)
return !memcmp(str, pfx, strlen(pfx));
}
-void print_hex(void *arg, unsigned int n, const char *sep)
+void fprint_hex(FILE *f, void *arg, unsigned int n, const char *sep)
{
unsigned char *data = arg;
unsigned int i;
@@ -111,13 +111,13 @@ void print_hex(void *arg, unsigned int n, const char *sep)
if (!i)
/* nothing */;
else if (!(i % 16))
- printf("\n");
+ fprintf(f, "\n");
else if (!(i % 8))
- printf(" ");
+ fprintf(f, " ");
else
pfx = sep;
- printf("%s%02hhx", i ? pfx : "", data[i]);
+ fprintf(f, "%s%02hhx", i ? pfx : "", data[i]);
}
}