diff options
Diffstat (limited to 'src/interfaces/ecpg/compatlib/informix.c')
-rw-r--r-- | src/interfaces/ecpg/compatlib/informix.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/src/interfaces/ecpg/compatlib/informix.c b/src/interfaces/ecpg/compatlib/informix.c index a7bbeb9223f..b2a19a1dd3a 100644 --- a/src/interfaces/ecpg/compatlib/informix.c +++ b/src/interfaces/ecpg/compatlib/informix.c @@ -175,25 +175,6 @@ deccopy(decimal *src, decimal *target) memcpy(target, src, sizeof(decimal)); } -static char * -ecpg_strndup(const char *str, size_t len) -{ - size_t real_len = strlen(str); - int use_len = (int) ((real_len > len) ? len : real_len); - - char *new = malloc(use_len + 1); - - if (new) - { - memcpy(new, str, use_len); - new[use_len] = '\0'; - } - else - errno = ENOMEM; - - return new; -} - int deccvasc(const char *cp, int len, decimal *np) { @@ -205,7 +186,7 @@ deccvasc(const char *cp, int len, decimal *np) if (risnull(CSTRINGTYPE, cp)) return 0; - str = ecpg_strndup(cp, len); /* decimal_in always converts the complete + str = pnstrdup(cp, len); /* decimal_in always converts the complete * string */ if (!str) ret = ECPG_INFORMIX_NUM_UNDERFLOW; |