diff options
| author | David Sommerseth <dazo@users.sourceforge.net> | 2011-07-25 13:01:11 +0200 |
|---|---|---|
| committer | David Sommerseth <dazo@users.sourceforge.net> | 2013-06-13 01:01:55 +0200 |
| commit | b4cba21ff4448b823c9f81c72c56c496e741f2a0 (patch) | |
| tree | 2672f46121a8fa81add1ee10b04ecefc32d17f2f /database/postgresql | |
| parent | a272e1ff8963533b5c71ad33171553c03e75bde8 (diff) | |
edb-pgsql: Make use of internal PGgetValue() instead of PQgetvalue() in eDBblacklist_check()
PGgetValue() will return NULL if the database field is NULL, which is
expected several places in the eDBblacklist_check() function.
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Diffstat (limited to 'database/postgresql')
| -rw-r--r-- | database/postgresql/edb-pgsql.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/database/postgresql/edb-pgsql.c b/database/postgresql/edb-pgsql.c index 1ea7367..3ee2b39 100644 --- a/database/postgresql/edb-pgsql.c +++ b/database/postgresql/edb-pgsql.c @@ -617,7 +617,7 @@ int eDBblacklist_check(eurephiaCTX *ctx, const int type, const char *val) } if( dbr && PQntuples(dbr) > 0 ) { - blid = PQgetvalue(dbr, 0, 0); + blid = PGgetValue(dbr, 0, 0); if( blid != NULL ) { eurephia_log(ctx, LOG_WARNING, 0, "Attempt from blacklisted %s: %s", eDBattempt_types[type].descr, val); @@ -663,8 +663,8 @@ int eDBblacklist_check(eurephiaCTX *ctx, const int type, const char *val) } if( dbr && (PQntuples(dbr) > 0) ) { - atpid = PQgetvalue(dbr, 0, 0); - atpexceed = atoi_nullsafe(PQgetvalue(dbr, 0, 1)); + atpid = PGgetValue(dbr, 0, 0); + atpexceed = atoi_nullsafe(PGgetValue(dbr, 0, 1)); // If [type] has reached attempt limit and it is not black listed, black list it if( (atpexceed > 0) && (blid == NULL) ) { |
