Skip to content

Commit

Permalink
Remove extraneous print statement.
Browse files Browse the repository at this point in the history
Fix off-by-one when specifying a COUNT greater than 0.
  • Loading branch information
scottsakai committed Feb 28, 2016
1 parent 517a736 commit 250de3a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ykksm-gen-keys
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,12 @@ if ($db) {
# pick the next available serial, if directed to.
if ($start == 0) {
my @row = $dbh->selectrow_array("SELECT max(serialnr), count(*) from yubikeys");
print "Counter is at $row[0] nrows $row[1]\n";
if ($row[0] >= 0 && $row[1] > 0) {
$start = $row[0] + 1;
$end = $start + $end; # end is a counter in this case, remember?

# end is a counter in this case, remember?
$end-- if ($end > 0);
$end = $start + $end;
}
}

Expand Down

0 comments on commit 250de3a

Please sign in to comment.