Skip to content

Commit 4678be6

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 d7e6868 commit 4678be6

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
@@ -667,12 +667,16 @@ dttofmtasc(timestamp * ts, char *output, int str_len, char *fmtstr)
667667
int
668668
intoasc(interval * i, char *str)
669669
{
670+
char *tmp;
671+
670672
errno = 0;
671-
str = PGTYPESinterval_to_asc(i);
673+
tmp = PGTYPESinterval_to_asc(i);
672674

673-
if (!str)
675+
if (!tmp)
674676
return -errno;
675677

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

0 commit comments

Comments
 (0)