summaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-09-15 16:40:11 -0400
committerNick Mathewson <nickm@torproject.org>2017-09-15 16:40:11 -0400
commit76c33f7ff46df47df0cc880595c4d943d50f019b (patch)
tree11448ec9afd6990160ce6212c020d3c2630448d6 /src/or/circuitbuild.c
parentc1deabd3b0c9e2701696afc80ac8392f0efda2c7 (diff)
parenta28e239b171c1a69fd32b6583bca0559f7116445 (diff)
downloadtor-76c33f7ff46df47df0cc880595c4d943d50f019b.tar.gz
tor-76c33f7ff46df47df0cc880595c4d943d50f019b.zip
Merge branch 'scan-build-032'
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index dea87e5915..aa048f8c31 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -2422,10 +2422,10 @@ cpath_get_n_hops(crypt_path_t **head_ptr)
}
tmp = *head_ptr;
- if (tmp) {
+ do {
n_hops++;
- tmp = (*head_ptr)->next;
- }
+ tmp = tmp->next;
+ } while (tmp != *head_ptr);
return n_hops;
}