fixes label key '0' to '9'.
lua_command_t new_command;
size_t l;
+ memset(&new_command, 0, sizeof(new_command));
new_command.command_name = luaL_checklstring(L, 1, &l);
if ( 2 != l ){
return luaL_error(L, "ime_register_command is called with command_name: %s, whose length is not 2.\n", new_command.command_name);
switch (m_mode) {
case LABEL_LIST_DIGIT:
switch (keyval) {
- case 1 ... 9:
+ case '1' ... '9':
return selectCandidateInPage (keyval - '1');
break;
- case 0:
+ case '0':
return selectCandidateInPage (9);
break;
}
m_mode = LABEL_NONE;
clearLookupTable ();
m_lookup_table.clear ();
- return false;
+ return FALSE;
}
if ( command->help ){
//Generate labels according to m_mode
if ( LABEL_LIST_DIGIT == m_mode ) {
for ( int i = 1; i <= 10; ++i )
- m_lookup_table.setLabel ( i - 1, Text (i - 1 + '0') );
+ m_lookup_table.setLabel ( i - 1, Text (i - 1 + '1') );
}
if ( LABEL_LIST_ALPHA == m_mode) {