From 2a022368f4b37559de5d5621a88c648023493f75 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 2 Sep 2010 10:09:09 -0700 Subject: Avoid shadowing local variable names. All of these changes avoid using the same name for two local variables within a same function. None of them are actual bugs as far as I can tell, but any of them could be confusing to the casual reader. The one in lib/ovsdb-idl.c is particularly brilliant: inner and outer loops both using (different) variables named 'i'. Found with GCC -Wshadow. --- lib/netdev-linux.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/netdev-linux.c') diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index e6036bfc5..7227f5dfc 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -1779,12 +1779,12 @@ netdev_linux_get_in6(const struct netdev *netdev_, struct in6_addr *in6) if (file != NULL) { const char *name = netdev_get_name(netdev_); while (fgets(line, sizeof line, file)) { - struct in6_addr in6; + struct in6_addr in6_tmp; char ifname[16 + 1]; - if (parse_if_inet6_line(line, &in6, ifname) + if (parse_if_inet6_line(line, &in6_tmp, ifname) && !strcmp(name, ifname)) { - netdev_dev->in6 = in6; + netdev_dev->in6 = in6_tmp; break; } } -- cgit v1.2.1