if (((unsigned int)name[0]) > 128 && (name[1] != 0)) {
/* Possible start of mb character. */
char mbc[2];
+ size_t size = 0;
/*
* Note that if CH_UNIX is utf8 a string may be 3
* bytes, but this is ok as mb utf8 characters don't
* for mb UNIX asian characters like Japanese (SJIS) here.
* JRA.
*/
- if (convert_string(CH_UNIX, CH_UTF16LE, name, 2, mbc, 2) == 2) {
- /* Was a good mb string. */
- name += 2;
- continue;
+ if (convert_string(CH_UNIX, CH_UTF16LE, name, 2, mbc, 2, &size)) {
+ if (size == 2) {
+ /* Was a good mb string. */
+ name += 2;
+ continue;
+ }
}
}