Permalink
Browse files

Make username parameter optional for password lookup query

  • Loading branch information...
1 parent 945a268 commit 69f92246c8895902ff8ac9fde221287a37872a83 @luke-jr luke-jr committed Apr 27, 2011
Showing with 5 additions and 3 deletions.
  1. +5 −3 db-sqlite.c
View
@@ -57,9 +57,11 @@ static char *sql_pwdb_lookup(const char *user)
goto err_out;
step++;
- rc = sqlite3_bind_text(stmt, 1, user, strlen(user), SQLITE_STATIC);
- if (rc != SQLITE_OK)
- goto err_out;
+ if (sqlite3_bind_parameter_count(stmt)) {
+ rc = sqlite3_bind_text(stmt, 1, user, strlen(user), SQLITE_STATIC);
+ if (rc != SQLITE_OK)
+ goto err_out;
+ }
step++;
rc = sqlite3_step(stmt);

0 comments on commit 69f9224

Please sign in to comment.