Don't include the terminating character when returning pcbInfoValue from SQL_GetInfo.
authorDave Page <dpage@pgadmin.org>
Mon, 26 Jul 2004 14:10:38 +0000 (14:10 +0000)
committerDave Page <dpage@pgadmin.org>
Mon, 26 Jul 2004 14:10:38 +0000 (14:10 +0000)
info.c
info30.c

diff --git a/info.c b/info.c
index d24adcc7908d7999f470042a3d9976fd7517ae3e..93294d966b0aef5cd6ee1815a207b5b82554fc4b 100644 (file)
--- 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;
 }
index c17eecb26e18ea998c703431e0eee9b77b09cbff..968eab155ee3837c022df7a2c89e520375517532 100644 (file)
--- 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;
 }