diff options
author | Michael Meskes <meskes@postgresql.org> | 2015-06-12 14:50:47 +0200 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2015-06-13 11:13:59 +0200 |
commit | 1ea539ae3fc197e6512e09609229a2bad8f3001d (patch) | |
tree | 3e2d216e8f3ff3d118a3df28650e27d10103b348 | |
parent | ae6ae424b502afcc514a2ce14de476a9714b6a75 (diff) |
Fix intoasc() in Informix compat lib. This function used to be a noop.
Patch by Michael Paquier
-rw-r--r-- | src/interfaces/ecpg/compatlib/informix.c | 8 |
1 files 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; } |