several fixes
This commit is contained in:
parent
f11ea5b54f
commit
b1babd4b88
4 changed files with 6 additions and 4 deletions
|
|
@ -190,7 +190,7 @@ int sj4_from_utf16(u_char* out, const u_char* in, int len) {
|
||||||
out += eucjp_write(out, n);
|
out += eucjp_write(out, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
return out - o_out;
|
return (out - o_out) * sizeof(wchar_t);
|
||||||
}
|
}
|
||||||
|
|
||||||
static u_int eucjp_read(const u_char* in) {
|
static u_int eucjp_read(const u_char* in) {
|
||||||
|
|
@ -287,7 +287,7 @@ int sj4_to_utf16(u_char* out, const u_char* in, int len) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return w_out - o_out;
|
return (w_out - o_out) * sizeof(wchar_t);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,8 @@ Sj4Context* alloccontext(const char* dic) {
|
||||||
DictFile* dict;
|
DictFile* dict;
|
||||||
DICTL* node;
|
DICTL* node;
|
||||||
|
|
||||||
|
if(ctx == NULL) return NULL;
|
||||||
|
|
||||||
if((ctx->work = calloc(1, sizeof(*ctx->work))) == NULL) {
|
if((ctx->work = calloc(1, sizeof(*ctx->work))) == NULL) {
|
||||||
free(ctx);
|
free(ctx);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,7 @@ void sj4_ime_key(Sj4Ime* ime, int key) {
|
||||||
|
|
||||||
key = toupper(key);
|
key = toupper(key);
|
||||||
|
|
||||||
if(ime->romabuf[strlen(ime->romabuf) - 1] == 'N' && !(key == 'A' || key == 'I' || key == 'U' || key == 'E' || key == 'O' || key == 'Y' || key == 'N')) {
|
if(strlen(ime->romabuf) > 0 && ime->romabuf[strlen(ime->romabuf) - 1] == 'N' && !(key == 'A' || key == 'I' || key == 'U' || key == 'E' || key == 'O' || key == 'Y' || key == 'N')) {
|
||||||
ime->romabuf[strlen(ime->romabuf) + 1] = 0;
|
ime->romabuf[strlen(ime->romabuf) + 1] = 0;
|
||||||
ime->romabuf[strlen(ime->romabuf)] = 'N';
|
ime->romabuf[strlen(ime->romabuf)] = 'N';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ int main() {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
conv = sj4_ime_convbuf(ime);
|
conv = sj4_ime_convbuf(ime);
|
||||||
kouho = sj4_ime_kouho(ime);
|
kouho = sj4_ime_kouho(ime);
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue