aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 d6de3eac997..8d81c83dedd 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;
}