Skip to content

Commit

Permalink
[CPAN-RT #72015] Last OID not returned by find_next_oid() (Pascal Ber…
Browse files Browse the repository at this point in the history
…inguie).
  • Loading branch information
maddingue committed Nov 14, 2012
1 parent c549cfb commit f5008e1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Revision history for SNMP-ToolBox

[BUGFIX] CPAN-RT #72315: Avoid a warning in _by_oid_classical (Elizabeth Cholet).
[BUGFIX] CPAN-RT #72015: Last OID not returned by find_next_oid() (Pascal Beringuie).

0.02 2011.08.12
[BUGFIX] Avoid a warning in find_next_oid().
Expand Down
2 changes: 1 addition & 1 deletion lib/SNMP/ToolBox.pm
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ sub find_next_oid {
}

# get the entry following the requested one
my $next_oid = (defined $next_oid_idx and $next_oid_idx < $#{$oid_list})
my $next_oid = (defined $next_oid_idx and $next_oid_idx <= $#{$oid_list})
? $oid_list->[$next_oid_idx]
: "NONE";

Expand Down
3 changes: 3 additions & 0 deletions t/30-find_next_oid.t
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ my @cases = (
[ "called with a request within the list, with no context",
[ $oid_list[4] ], $oid_list[5] ],

[ "called with a request just before the end of the list, with no context",
[ $oid_list[-2] ], $oid_list[-1] ],

[ "called with a request outside the list, with no context",
[ "$base_oid.5" ], "NONE" ],

Expand Down

0 comments on commit f5008e1

Please sign in to comment.