diff options
author | Kevin Lo <kevlo@FreeBSD.org> | 2012-05-21 02:23:20 +0000 |
---|---|---|
committer | Kevin Lo <kevlo@FreeBSD.org> | 2012-05-21 02:23:20 +0000 |
commit | bc6f23e0ad548f2493d503fc7ad86ebed1e2735b (patch) | |
tree | c6853dcb818aad874e3ed1f71c73145a71d06f46 /sys/libkern/iconv_ucs.c | |
parent | c41941dfeb74455f2e57b839f908e7810376cfd9 (diff) | |
download | src-test2-bc6f23e0ad548f2493d503fc7ad86ebed1e2735b.tar.gz src-test2-bc6f23e0ad548f2493d503fc7ad86ebed1e2735b.zip |
Notes
Diffstat (limited to 'sys/libkern/iconv_ucs.c')
-rw-r--r-- | sys/libkern/iconv_ucs.c | 8 |
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); |