Skip to content

Commit 52f5fcd

Browse files
committed
Fix a bug in canonical IPv6 address printing
There was a bug where all trailing quartets would not be printed if there was only a single section of zeros.
1 parent 9e8de77 commit 52f5fcd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/subnet

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ ints_to_ipv6() {
130130
for (( i = 0; i < ${#quartets[@]}; i++ )); do
131131
if (( quartets[i] == 0 )); then
132132
(( curr_start_idx = i ))
133+
(( curr_end_idx = i))
133134
for (( j = i + 1; j < ${#quartets[@]}; j++ )); do
134135
if (( quartets[j] == 0 )); then
135136
(( curr_end_idx = j ))

0 commit comments

Comments
 (0)