aboutsummaryrefslogtreecommitdiff
path: root/reselect
diff options
context:
space:
mode:
Diffstat (limited to 'reselect')
-rw-r--r--reselect6
1 files changed, 4 insertions, 2 deletions
diff --git a/reselect b/reselect
index c1cdb7c..e42fd9f 100644
--- a/reselect
+++ b/reselect
@@ -26,9 +26,11 @@ sub hint_iterator {
my ($len) = @_;
# generate fixed-length codes of sufficient length for all matches
- my $code_len = POSIX::ceil(log($len) / log(@hintchars));
- if ($code_len == 0) {
+ my $code_len;
+ if ($len == 0) {
$code_len = 1;
+ } else {
+ $code_len = POSIX::ceil(log($len) / log(@hintchars));
}
my $state = 0;