Fix intoasc() in Informix compat lib. This function used to be a noop.

Patch by Michael Paquier
This commit is contained in:
Michael Meskes 2015-06-12 14:50:47 +02:00
parent 091c02a958
commit 82be1bf509

View File

@ -666,12 +666,16 @@ dttofmtasc(timestamp * ts, char *output, int str_len, char *fmtstr)
int
intoasc(interval * i, char *str)
{
errno = 0;
str = PGTYPESinterval_to_asc(i);
char *tmp;
if (!str)
errno = 0;
tmp = PGTYPESinterval_to_asc(i);
if (!tmp)
return -errno;
memcpy(str, tmp, strlen(tmp));
free(tmp);
return 0;
}