diff options
author | niq <niq@13f79535-47bb-0310-9956-ffa450edef68> | 2008-10-15 18:24:00 +0000 |
---|---|---|
committer | niq <niq@13f79535-47bb-0310-9956-ffa450edef68> | 2008-10-15 18:24:00 +0000 |
commit | 0eedd015e920ac5d5f0f7032f130d31f5ca5f065 (patch) | |
tree | c146942e4ced9c15565d3c182ad62091fa70bd28 | |
parent | 235a89b3805243ce4394671791e36fa6f8c1fae3 (diff) | |
download | libapr-util-0eedd015e920ac5d5f0f7032f130d31f5ca5f065.tar.gz |
Suppress pgsql column-out-of-range warning
PR 46012 - patch from Michiel van Loon.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/trunk@704986 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | dbd/apr_dbd_pgsql.c | 7 |
2 files changed, 9 insertions, 1 deletions
@@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with APR-util 1.4.0 + *) Suppress pgsql column-out-of-range warning. + PR 46012 [Michiel van Loon <michiel van-loon.xs4all.nl>] + *) Move APU_HAVE_CRYPTO from private apu_config.h to public apu.h. [Ruediger Pluem, Graham Leggett] diff --git a/dbd/apr_dbd_pgsql.c b/dbd/apr_dbd_pgsql.c index daf0dab0..606accd5 100644 --- a/dbd/apr_dbd_pgsql.c +++ b/dbd/apr_dbd_pgsql.c @@ -218,7 +218,12 @@ static int dbd_pgsql_select(apr_pool_t *pool, apr_dbd_t *sql, static const char *dbd_pgsql_get_name(const apr_dbd_results_t *res, int n) { - return (res->res ? PQfname(res->res, n) : NULL); + if (res->res) { + if ((n>=0) && (PQnfields(res->res) > n)) { + return PQfname(res->res,n); + } + } + return NULL; } static int dbd_pgsql_get_row(apr_pool_t *pool, apr_dbd_results_t *res, |