postgres.git / summary / log / commit / refs
commit 1ea539ae3fc197e6512e09609229a2bad8f3001d
Author: Michael Meskes <meskes@postgresql.org>
Date: Fri Jun 12 12:50:47 2015 +0000
First released in: 9.5.0, 9.0.23, 9.1.19, 9.2.14, 9.3.10, 9.4.5
Fix intoasc() in Informix compat lib. This function used to be a noop.
Patch by Michael Paquier
src/interfaces/ecpg/compatlib/informix.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/interfaces/ecpg/compatlib/informix.c b/src/interfaces/ecpg/compatlib/informix.c
index 3b30864866b..fdd175983e1 100644
--- a/src/interfaces/ecpg/compatlib/informix.c
+++ b/src/interfaces/ecpg/compatlib/informix.c
@@ -667,12 +667,16 @@ dttofmtasc(timestamp * ts, char *output, int str_len, char *fmtstr)
int
intoasc(interval * i, char *str)
{
+ char *tmp;
+
errno = 0;
- str = PGTYPESinterval_to_asc(i);
+ tmp = PGTYPESinterval_to_asc(i);
- if (!str)
+ if (!tmp)
return -errno;
+ memcpy(str, tmp, strlen(tmp));
+ free(tmp);
return 0;
}
[parent: ae6ae424b502]