--- leif/freewnn/freewnn.c.orig Sun Mar 20 11:41:29 2005 +++ leif/freewnn/freewnn.c Wed May 18 01:20:56 2005 @@ -59,7 +59,7 @@ #define BUFSIZE 1024 #endif -#define WNNRCFILE "/etc/FreeWnn/ja/wnnenvrc" +#define WNNRCFILE "%%LOCALBASE%%" "/lib/wnn/ja_JP/wnnenvrc" #define CSC_OPEN_LOCALE "csconv_open_locale" #define CSC_OPEN "csconv_open" @@ -162,7 +162,7 @@ int count = 0; if( str == NULL ) return NULL; - if( *str == '\0' ) return NULL; + if( *str == '\0' ) return ""; for(i=0;itext.utf_chars, ustr, (ustrlen(ustr)+1)*sizeof(UTFCHAR)); + if (p && ustr) { + memcpy(p->text.utf_chars, ustr, (ustrlen(ustr)+1)*sizeof(UTFCHAR)); + } + if (ustr) free(ustr); return p; } @@ -479,7 +490,10 @@ ustr = euc2UTFCHAR(str); p = create_IMText(s, ustrlen(ustr)); - memcpy(p->text.utf_chars, ustr, (ustrlen(ustr)+1)*sizeof(UTFCHAR)); + if (p && ustr) { + memcpy(p->text.utf_chars, ustr, (ustrlen(ustr)+1)*sizeof(UTFCHAR)); + } + if (ustr) free(ustr); return p; }