diff mm7text_ru.cpp @ 250:83f85ab6079a

sprintfex fix
author Nomad
date Mon, 18 Feb 2013 07:26:48 +0200
parents 37dcbe8f3cca
children d1af3319bc44
line wrap: on
line diff
--- a/mm7text_ru.cpp	Mon Feb 18 07:13:20 2013 +0200
+++ b/mm7text_ru.cpp	Mon Feb 18 07:26:48 2013 +0200
@@ -1085,12 +1085,13 @@
   while (left <= right)
   {
     match = left + (right - left) / 2;
-    switch (_mbsncmp(name, (unsigned char *)table[match].name, name_len))
-    {
-      case -1: right = match; break;
-      case  0: return table[match].gender;
-      case  1: left = match; break;
-    }
+    int rval = _mbsncmp(name, (unsigned char *)table[match].name, name_len);
+    if (rval < 0)
+      right = match;
+    else if (!rval)
+      return table[match].gender;
+    else
+      left = match;
   }
   assert(false);
   return 0;