summaryrefslogtreecommitdiffstats
path: root/lib/libc/iconv/bsd_iconv.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/iconv/bsd_iconv.c')
-rw-r--r--lib/libc/iconv/bsd_iconv.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/libc/iconv/bsd_iconv.c b/lib/libc/iconv/bsd_iconv.c
index e9ff688..ca0b706 100644
--- a/lib/libc/iconv/bsd_iconv.c
+++ b/lib/libc/iconv/bsd_iconv.c
@@ -267,8 +267,9 @@ __bsd_iconvctl(iconv_t cd, int request, void *argument)
struct _citrus_iconv *cv;
struct iconv_hooks *hooks;
const char *convname;
- char src[PATH_MAX], *dst;
+ char *dst;
int *i;
+ size_t srclen;
cv = (struct _citrus_iconv *)(void *)cd;
hooks = (struct iconv_hooks *)argument;
@@ -283,12 +284,9 @@ __bsd_iconvctl(iconv_t cd, int request, void *argument)
case ICONV_TRIVIALP:
convname = cv->cv_shared->ci_convname;
dst = strchr(convname, '/');
-
- strlcpy(src, convname, dst - convname + 1);
+ srclen = dst - convname;
dst++;
- if ((convname == NULL) || (src == NULL) || (dst == NULL))
- return (-1);
- *i = strcmp(src, dst) == 0 ? 1 : 0;
+ *i = (srclen == strlen(dst)) && !memcmp(convname, dst, srclen);
return (0);
case ICONV_GET_TRANSLITERATE:
*i = 1;
OpenPOWER on IntegriCloud