Skip to content

Commit 82be1bf

Browse files
author
Michael Meskes
committed
Fix intoasc() in Informix compat lib. This function used to be a noop.
Patch by Michael Paquier
1 parent 091c02a commit 82be1bf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/interfaces/ecpg/compatlib/informix.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,12 +666,16 @@ dttofmtasc(timestamp * ts, char *output, int str_len, char *fmtstr)
666666
int
667667
intoasc(interval * i, char *str)
668668
{
669+
char *tmp;
670+
669671
errno = 0;
670-
str = PGTYPESinterval_to_asc(i);
672+
tmp = PGTYPESinterval_to_asc(i);
671673

672-
if (!str)
674+
if (!tmp)
673675
return -errno;
674676

677+
memcpy(str, tmp, strlen(tmp));
678+
free(tmp);
675679
return 0;
676680
}
677681

0 commit comments

Comments
 (0)