[uim-commit] r717 - trunk/uim

tkng at freedesktop.org tkng at freedesktop.org
Thu Feb 24 11:26:42 PST 2005


Author: tkng
Date: 2005-02-24 11:26:39 -0800 (Thu, 24 Feb 2005)
New Revision: 717

Modified:
   trunk/uim/m17nlib.c
Log:
* uim/m17nlib.c:
 -(find_im_by_name): Fix the case if lang == NULL. Thanks to Kenichi Handa
   for reporting.


Modified: trunk/uim/m17nlib.c
===================================================================
--- trunk/uim/m17nlib.c	2005-02-24 19:00:48 UTC (rev 716)
+++ trunk/uim/m17nlib.c	2005-02-24 19:26:39 UTC (rev 717)
@@ -493,7 +493,11 @@
   name = &name[5];
   for (i = 0; i < nr_input_methods; i++) {
     char buf[100];
-    sprintf(buf, "%s-%s", im_array[i].lang, im_array[i].name);
+    if(im_array[i].lang == NULL) {
+      snprintf(buf, 100, "%s", im_array[i].name);
+    } else {
+      snprintf(buf, 100, "%s-%s", im_array[i].lang, im_array[i].name);
+    }
     if (!strcmp(name, buf)) {
       return im_array[i].im;
     }



More information about the Uim-commit mailing list