[uim-commit] r905 - trunk/xim

ekato at freedesktop.org ekato at freedesktop.org
Thu Jun 23 08:56:53 PDT 2005


Author: ekato
Date: 2005-06-23 08:56:50 -0700 (Thu, 23 Jun 2005)
New Revision: 905

Modified:
   trunk/xim/convdisp.cpp
Log:
* xim/convdisp.cpp (PeWin::get_fontsize) : Cope with font size
  with three digits.


Modified: trunk/xim/convdisp.cpp
===================================================================
--- trunk/xim/convdisp.cpp	2005-06-22 15:50:23 UTC (rev 904)
+++ trunk/xim/convdisp.cpp	2005-06-23 15:56:50 UTC (rev 905)
@@ -563,8 +563,9 @@
 
 int PeWin::get_fontsize(const char *xfld)
 {
+#define MAX_DIGIT_OF_PIXEL_SIZE	3
     int size;
-    char str[3];
+    char str[MAX_DIGIT_OF_PIXEL_SIZE + 1];
     const char *p = xfld;
     int count = 0;
     int i, j = 0;
@@ -578,6 +579,8 @@
 		str[j] = p[i];
 		i++;
 		j++;
+		if (j > MAX_DIGIT_OF_PIXEL_SIZE)
+		    return -1;
 	    }
 	    str[j] = '\0';
 	    break;



More information about the uim-commit mailing list