try {
Key = keyname_to_keycode(name);
m_name = name;
- if (strlen(name) > 8)
- mbtowc(&Char, name + 8, 1);
- else
+ if (strlen(name) > 8) {
+ int chars_read = mbtowc(&Char, name + 8, 1);
+ assert (chars_read == 1 && "unexpected multibyte character");
+ } else
Char = L'\0';
return;
} catch (UnknownKeycode &e) {};
m_name += name;
try {
Key = keyname_to_keycode(m_name.c_str());
- mbtowc(&Char, name, 1);
+ int chars_read = mbtowc(&Char, name, 1);
+ assert (chars_read == 1 && "unexpected multibyte character");
return;
} catch (UnknownKeycode &e) {};
}
Key = irr::KEY_KEY_CODES_COUNT;
- mbtowc(&Char, name, 1);
+ int mbtowc_ret = mbtowc(&Char, name, 1);
+ assert (mbtowc_ret == 1 && "unexpected multibyte character");
m_name = name[0];
}
} else {
size_t maxlen = wctomb(NULL, Char);
m_name.resize(maxlen+1, '\0');
- wctomb(&m_name[0], Char);
+ int written = wctomb(&m_name[0], Char);
+ assert (written >= 0 && "unexpected multibyte character");
}
}