diff options
author | Thomas Haller <thaller@redhat.com> | 2016-11-29 11:33:27 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-11-29 11:37:00 (GMT) |
commit | a078e364fb8d7da231becf9a7a1471a183b8c416 (patch) | |
tree | 84414067edc26841a0de55472936aa3d23eddb9a /src | |
parent | 5040fc8a4994f7e3acc186639c37bf75ec332966 (diff) | |
download | libnl-a078e364fb8d7da231becf9a7a1471a183b8c416.zip libnl-a078e364fb8d7da231becf9a7a1471a183b8c416.tar.gz libnl-a078e364fb8d7da231becf9a7a1471a183b8c416.tar.bz2 |
nl-link-stats: prefer RTNL_LINK_STATS_MAX over __RTNL_LINK_STATS_MAX
The result is basically the same, but I feel that __RTNL_LINK_STATS_MAX
is an internal variable that shouldn't be used. Thus, let's iterate
instead until <= MAX.
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/nl-link-stats.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nl-link-stats.c b/src/nl-link-stats.c index a274e2e..9bb11c8 100644 --- a/src/nl-link-stats.c +++ b/src/nl-link-stats.c @@ -34,7 +34,7 @@ static void list_stat_names(void) char buf[64]; int i; - for (i = 0; i < __RTNL_LINK_STATS_MAX; i++) + for (i = 0; i <= RTNL_LINK_STATS_MAX; i++) printf("%s\n", rtnl_link_stat2str(i, buf, sizeof(buf))); exit(0); @@ -59,7 +59,7 @@ static void dump_stats(struct nl_object *obj, void *arg) if (optind >= gargc) { int i; - for (i = 0; i < __RTNL_LINK_STATS_MAX; i++) + for (i = 0; i <= RTNL_LINK_STATS_MAX; i++) dump_stat(link, i); } else { while (optind < gargc) { |