diff options
author | Debarshi Ray <debarshir@gnome.org> | 2018-03-14 12:36:38 +0100 |
---|---|---|
committer | Debarshi Ray <debarshir@gnome.org> | 2018-04-03 11:59:00 +0200 |
commit | 513220cd80272947ccdcb6b13d7b48ba9bd1d601 (patch) | |
tree | 1e9f501a038cc146e733f65efd9479f2c60f3392 /src/ring.cc | |
parent | 43cd3d176264656956febf4f6f29c120e5c73df9 (diff) | |
download | vte-513220cd80272947ccdcb6b13d7b48ba9bd1d601.tar.gz |
ring: Silence -Wunsafe-loop-optimizations
https://bugzilla.gnome.org/show_bug.cgi?id=789778
Diffstat (limited to 'src/ring.cc')
-rw-r--r-- | src/ring.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ring.cc b/src/ring.cc index 05e938ea..2db4b0ec 100644 --- a/src/ring.cc +++ b/src/ring.cc @@ -244,7 +244,8 @@ _vte_ring_get_hyperlink_idx_no_update_current (VteRing *ring, const char *hyperl len = strlen(hyperlink); /* Linear search for this particular URI */ - for (idx = 1; idx <= ring->hyperlink_highest_used_idx; idx++) { + auto const last_idx = ring->hyperlink_highest_used_idx + 1; + for (idx = 1; idx < last_idx; idx++) { if (strcmp(hyperlink_get(ring, idx)->str, hyperlink) == 0) { _vte_debug_print (VTE_DEBUG_HYPERLINK, "get_hyperlink_idx: already existing idx %d for id;uri=\"%s\"\n", |