]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a bug in displaying IPv6 addrs in test_op_ipv6_ with --verbose
authorNick Mathewson <nickm@torproject.org>
Tue, 11 Oct 2016 23:22:46 +0000 (19:22 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 12 Oct 2016 00:09:24 +0000 (20:09 -0400)
The test code, if it failed, or if it was run in verbose mode, would
use the wrong variable for its loop.  Patch from rubiate uploaded to
19999.

src/test/test_addr.c

index c8a9e6d384db7fde11c72271cf8a4959e1b5aaeb..49e248014f7a5e6cc0820c7fc71c6269c888e345 100644 (file)
@@ -85,8 +85,8 @@ test_addr_basic(void *arg)
     char *, "%s",                                                \
     { char *cp;                                                  \
       cp = print_ = tor_malloc(64);                              \
-      for (int ii_=0;i<16;++i) {                                 \
-        tor_snprintf(cp, 3,"%02x", (unsigned)value_->s6_addr[i]);\
+      for (int ii_=0;ii_<16;++ii_) {                             \
+        tor_snprintf(cp, 3,"%02x", (unsigned)value_->s6_addr[ii_]);     \
         cp += 2;                                                 \
         if (ii_ != 15) *cp++ = ':';                              \
       }                                                          \