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:08:16 +0200 |
commit | d65e5f832ebd784f98c3a68f8572ff39f91446be (patch) | |
tree | 79795188ceed2fca2ff20f7f0fd8f0a173ec0885 /src | |
parent | 9e86bc29b6e5dba11e687161c3520b90b570e491 (diff) |
Fix intoasc() in Informix compat lib. This function used to be a noop.
Patch by Michael Paquier
Diffstat (limited to 'src')
-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 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; } |