From: teor (Tim Wilson-Brown) Date: Fri, 8 Jul 2016 02:30:20 +0000 (+1000) Subject: Improve comments in circuit_get_cpath_* X-Git-Tag: tor-0.2.9.3-alpha~111^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cad9046632aa168eabda1694775393b38922a03e;p=thirdparty%2Ftor.git Improve comments in circuit_get_cpath_* --- diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index d2ba7d4781..0d56a7ee20 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -1613,7 +1613,8 @@ circuit_find_to_cannibalize(uint8_t purpose, extend_info_t *info, return best; } -/** Return the number of hops in circuit's path. */ +/** Return the number of hops in circuit's path. If circ has no entries, + * or is NULL, returns 0. */ int circuit_get_cpath_len(origin_circuit_t *circ) { @@ -1629,7 +1630,8 @@ circuit_get_cpath_len(origin_circuit_t *circ) } /** Return the hopnumth hop in circ->cpath, or NULL if there - * aren't that many hops in the list. */ + * aren't that many hops in the list. hopnum starts at 1. + * Returns NULL if hopnum is 0 or negative. */ crypt_path_t * circuit_get_cpath_hop(origin_circuit_t *circ, int hopnum) {