[uim-commit] r690 - trunk/uim

ekato at freedesktop.org ekato at freedesktop.org
Sun Feb 20 19:49:55 PST 2005


Author: ekato
Date: 2005-02-20 19:49:53 -0800 (Sun, 20 Feb 2005)
New Revision: 690

Modified:
   trunk/uim/slib.c
Log:
* uim/slib.c (string_equal) : Fix to avoid crashes when using
  wrong type of argument in string=?


Modified: trunk/uim/slib.c
===================================================================
--- trunk/uim/slib.c	2005-02-21 02:47:57 UTC (rev 689)
+++ trunk/uim/slib.c	2005-02-21 03:49:53 UTC (rev 690)
@@ -2239,9 +2239,22 @@
 
 
 static LISP
+err_wta_str (LISP exp)
+{
+  return (my_err ("not a string", exp));
+}
+
+static LISP
 string_equal (LISP a, LISP b)
 {
   long len;
+  
+  if NTYPEP(a, tc_string)
+    return (err_wta_str(a));
+
+  if NTYPEP(b, tc_string)
+    return (err_wta_str(b));
+
   len = a->storage_as.string.dim;
   if (len != b->storage_as.string.dim)
     return (NIL);
@@ -3693,13 +3706,7 @@
   return (1);
 }
 
-static LISP
-err_wta_str (LISP exp)
-{
-  return (my_err ("not a string", exp));
-}
 
-
 static LISP
 string_length (LISP string)
 {



More information about the Uim-commit mailing list