Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Make username parameter optional for password lookup query

  • Loading branch information...
commit 69f92246c8895902ff8ac9fde221287a37872a83 1 parent 945a268
Luke-Jr luke-jr authored

Showing 1 changed file with 5 additions and 3 deletions. Show diff stats Hide diff stats

  1. +5 3 db-sqlite.c
8 db-sqlite.c
@@ -57,9 +57,11 @@ static char *sql_pwdb_lookup(const char *user)
57 57 goto err_out;
58 58
59 59 step++;
60   - rc = sqlite3_bind_text(stmt, 1, user, strlen(user), SQLITE_STATIC);
61   - if (rc != SQLITE_OK)
62   - goto err_out;
  60 + if (sqlite3_bind_parameter_count(stmt)) {
  61 + rc = sqlite3_bind_text(stmt, 1, user, strlen(user), SQLITE_STATIC);
  62 + if (rc != SQLITE_OK)
  63 + goto err_out;
  64 + }
63 65
64 66 step++;
65 67 rc = sqlite3_step(stmt);

0 comments on commit 69f9224

Please sign in to comment.
Something went wrong with that request. Please try again.