<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40196 >

Try with this patch.

I also noticed a long time ago that the client sends lot of wrong
commands to the server, confusing player names and connection names, the
commands names and adding '"' characters that the server doesn't remove
when it interpret it. See PR#39614.

Index: utility/support.c
===================================================================
--- utility/support.c	(révision 14560)
+++ utility/support.c	(copie de travail)
@@ -143,7 +143,7 @@
   size_t i;
   char c;
 
-  for (i = 0; i < n && *str0 != '\0'; i++) {
+  for (i = 0; i < n && *str0 != '\0' && *str1 != '\0'; i++) {
     if (my_tolower(*str0) != my_tolower(*str1)
         && *str0 != '"' && *str1 != '"') {
       return ((int) (unsigned char) my_tolower(*str0))
@@ -153,7 +153,13 @@
     str0 += (*str1 != '"');
     str1 += (c != '"');
   }
-  return 0;
+
+  if (i == n) {
+    return 0;
+  } else {
+    return ((int) (unsigned char) my_tolower(*str0))
+	   - ((int) (unsigned char) my_tolower(*str1));
+  }
 }
 
 /***************************************************************
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to