From 5a6b42d3b53cac12b0a6bc6f3cccfbfc1896039f Mon Sep 17 00:00:00 2001 From: Dave Page Date: Mon, 26 Jul 2004 14:10:38 +0000 Subject: [PATCH] Don't include the terminating character when returning pcbInfoValue from SQL_GetInfo. --- info.c | 10 +++++++++- info30.c | 11 ++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/info.c b/info.c index d24adcc..93294d9 100644 --- a/info.c +++ b/info.c @@ -783,7 +783,15 @@ PGAPI_GetInfo( } if (pcbInfoValue) - *pcbInfoValue = len; + { + if (p) /* Don't include terminator for strings */ + if (conn->unicode) + *pcbInfoValue = len - WCLEN; + else + *pcbInfoValue = len - 1; + else + *pcbInfoValue = len; + } return result; } diff --git a/info30.c b/info30.c index c17eecb..968eab1 100644 --- a/info30.c +++ b/info30.c @@ -401,7 +401,16 @@ PGAPI_GetInfo30(HDBC hdbc, UWORD fInfoType, PTR rgbInfoValue, } if (pcbInfoValue) - *pcbInfoValue = len; + { + if (p) /* Don't include terminator for strings */ + if (conn->unicode) + *pcbInfoValue = len - WCLEN; + else + *pcbInfoValue = len - 1; + else + *pcbInfoValue = len; + } + return result; } -- 2.39.5