summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meskes2015-06-12 12:50:47 +0000
committerMichael Meskes2015-06-12 12:50:47 +0000
commit82be1bf5099c0f6d1ef482ba3ca9cf1741db1eb3 (patch)
treef543f62d51af6e80f3316062037c6b4ef159e2ad
parent091c02a958fd0ae02b96492d9728efe8526385e6 (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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/compatlib/informix.c b/src/interfaces/ecpg/compatlib/informix.c
index d6de3eac99..8d81c83ded 100644
--- a/src/interfaces/ecpg/compatlib/informix.c
+++ b/src/interfaces/ecpg/compatlib/informix.c
@@ -666,12 +666,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;
}