Changeset 851 in openpam


Ignore:
Timestamp:
Dec 15, 2014, 5:11:36 PM (6 years ago)
Author:
Dag-Erling Smørgrav
Message:

Silence an uninitialized variable warning from gcc, which does not realize
that the resynchronization loop will always run at least once.
Adjust the loop condition, which unintentionally ignored errors.
Remove a debugging message.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/oathkey/oathkey.c

    r850 r851  
    355355                /* this should be a library function */
    356356                counter = key->counter;
    357                 while (key->counter < counter + w) {
     357                match = 0;
     358                while (key->counter < counter + w && match == 0) {
    358359                        match = oath_hotp_match(key, response[0],
    359360                            counter + w - key->counter - 1);
    360                         warnx("%d", match);
    361361                        if (match <= 0)
    362362                                break;
     
    365365                }
    366366                if (verbose && match > 0)
    367                         warnx("skipped %lu codes", key->counter - counter - 1);
     367                        warnx("skipped %lu codes", key->counter - counter);
    368368                break;
    369369        default:
Note: See TracChangeset for help on using the changeset viewer.