diff options
author | Chang-Hsien Tsai <luke.tw@gmail.com> | 2019-05-26 10:32:11 +0000 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-05-28 10:54:01 +0200 |
commit | 92bd6820f2b11c2decdd92e1f9020e804dbc2ed1 (patch) | |
tree | 5dfc445288bf7446cc88dec4319d27e243a0e237 /tools/bpf | |
parent | e1afb70252a8614e1ef7aec05ff1b84fd324b782 (diff) | |
download | linux-92bd6820f2b11c2decdd92e1f9020e804dbc2ed1.tar.bz2 |
bpf: style fix in while(!feof()) loop
Use fgets() as the while loop condition.
Signed-off-by: Chang-Hsien Tsai <luke.tw@gmail.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/bpf')
-rw-r--r-- | tools/bpf/bpftool/xlated_dumper.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/bpf/bpftool/xlated_dumper.c b/tools/bpf/bpftool/xlated_dumper.c index 0bb17bf88b18..494d7ae3614d 100644 --- a/tools/bpf/bpftool/xlated_dumper.c +++ b/tools/bpf/bpftool/xlated_dumper.c @@ -31,9 +31,7 @@ void kernel_syms_load(struct dump_data *dd) if (!fp) return; - while (!feof(fp)) { - if (!fgets(buff, sizeof(buff), fp)) - break; + while (fgets(buff, sizeof(buff), fp)) { tmp = reallocarray(dd->sym_mapping, dd->sym_count + 1, sizeof(*dd->sym_mapping)); if (!tmp) { |