summaryrefslogtreecommitdiff
path: root/sys/libkern/iconv_ucs.c
diff options
context:
space:
mode:
authorKevin Lo <kevlo@FreeBSD.org>2012-05-21 02:23:20 +0000
committerKevin Lo <kevlo@FreeBSD.org>2012-05-21 02:23:20 +0000
commitbc6f23e0ad548f2493d503fc7ad86ebed1e2735b (patch)
treec6853dcb818aad874e3ed1f71c73145a71d06f46 /sys/libkern/iconv_ucs.c
parentc41941dfeb74455f2e57b839f908e7810376cfd9 (diff)
downloadsrc-test2-bc6f23e0ad548f2493d503fc7ad86ebed1e2735b.tar.gz
src-test2-bc6f23e0ad548f2493d503fc7ad86ebed1e2735b.zip
Notes
Diffstat (limited to 'sys/libkern/iconv_ucs.c')
-rw-r--r--sys/libkern/iconv_ucs.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/libkern/iconv_ucs.c b/sys/libkern/iconv_ucs.c
index c6f28236a743..479dad8f647a 100644
--- a/sys/libkern/iconv_ucs.c
+++ b/sys/libkern/iconv_ucs.c
@@ -102,12 +102,12 @@ iconv_ucs_open(struct iconv_converter_class *dcp,
if (cspf)
dp->convtype |= KICONV_UCS_COMBINE;
for (i = 0; unicode_family[i].name; i++) {
- if (strcmp(from, unicode_family[i].name) == 0)
+ if (strcasecmp(from, unicode_family[i].name) == 0)
dp->convtype |= unicode_family[i].from_flag;
- if (strcmp(to, unicode_family[i].name) == 0)
+ if (strcasecmp(to, unicode_family[i].name) == 0)
dp->convtype |= unicode_family[i].to_flag;
}
- if (strcmp(ENCODING_UNICODE, ENCODING_UTF16) == 0)
+ if (strcasecmp(ENCODING_UNICODE, ENCODING_UTF16) == 0)
dp->convtype |= KICONV_UCS_UCS4;
else
dp->convtype &= ~KICONV_UCS_UCS4;
@@ -457,8 +457,6 @@ utf8_to_ucs4(const char *src, size_t *utf8width, size_t srclen)
/* out of utf-16 range or having illegal bits */
return (0);
}
- if (w == 0)
- return (0);
if (srclen < w)
return (0);