diff options
Diffstat (limited to 'src/interfaces/ecpg/compatlib/informix.c')
-rw-r--r-- | src/interfaces/ecpg/compatlib/informix.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/interfaces/ecpg/compatlib/informix.c b/src/interfaces/ecpg/compatlib/informix.c index a8a95f4e437..cfde8be5aa1 100644 --- a/src/interfaces/ecpg/compatlib/informix.c +++ b/src/interfaces/ecpg/compatlib/informix.c @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/informix.c,v 1.47 2006/08/15 06:40:19 meskes Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/informix.c,v 1.48 2006/10/04 00:30:11 momjian Exp $ */ #include <stdlib.h> #include <string.h> @@ -169,15 +169,16 @@ ecpg_strndup(const char *str, size_t len) int deccvasc(char *cp, int len, decimal *np) { - char *str; - int ret = 0; - numeric *result; + char *str; + int ret = 0; + numeric *result; rsetnull(CDECIMALTYPE, (char *) np); if (risnull(CSTRINGTYPE, cp)) return 0; - str = ecpg_strndup(cp, len); /* decimal_in always converts the complete string */ + str = ecpg_strndup(cp, len);/* decimal_in always converts the complete + * string */ if (!str) ret = ECPG_INFORMIX_NUM_UNDERFLOW; else @@ -378,8 +379,8 @@ dectoasc(decimal *np, char *cp, int len, int right) return -1; /* - * TODO: have to take care of len here and create exponential notation - * if necessary + * TODO: have to take care of len here and create exponential notation if + * necessary */ if ((int) (strlen(str) + 1) > len) { @@ -647,7 +648,7 @@ intoasc(interval * i, char *str) } /* - * rfmt.c - description + * rfmt.c - description * by Carsten Wolff <carsten.wolff@credativ.de>, Wed Apr 2 2003 */ @@ -936,7 +937,8 @@ byleng(char *str, int len) void ldchar(char *src, int len, char *dest) { - int dlen = byleng(src, len); + int dlen = byleng(src, len); + memmove(dest, src, dlen); dest[dlen] = '\0'; } |