Added missing terminating '\0' char for data put into char *.
authorMichael Meskes
Sun, 22 Jun 2003 11:00:48 +0000 (11:00 +0000)
committerMichael Meskes
Sun, 22 Jun 2003 11:00:48 +0000 (11:00 +0000)
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ecpglib/data.c

index 8c1f9817e6b182123b566cf21ae948a65f181a00..a8daf97af747ad9dae5e6f39178ddbbb4e0c18f3 100644 (file)
@@ -1510,6 +1510,10 @@ Fri Jun 20 15:34:29 CEST 2003
 
    - For Informix compatibility we have to accept a "free ".
    - Synced scan.l and pgc.l.
+   
+Sun Jun 22 11:20:29 CEST 2003
+
+   - Fixed missing '\0' in output char pointer.
    - Set ecpg version to 3.0.0
    - Set ecpg library to 4.0.0
    - Set pgtypes library to 1.0.0
index 97c0172f91467d69bbb1cd6371948672d3b7fe75..0930380829fffebac98d6cc4c867c2615fa6efa1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.6 2003/06/19 09:52:11 meskes Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.7 2003/06/22 11:00:48 meskes Exp $ */
 
 #define POSTGRES_ECPG_INTERNAL
 #include "postgres_fe.h"
@@ -302,7 +302,7 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
                {
                    if (varcharsize == 0)
                    {
-                       strncpy((char *) ((long) var + offset * act_tuple), pval, strlen(pval));
+                       strncpy((char *) ((long) var + offset * act_tuple), pval, strlen(pval)+1);
                    }
                    else
                    {