Author: cazfi
Date: Fri May  5 07:51:25 2017
New Revision: 35397

URL: http://svn.gna.org/viewcvs/freeciv?rev=35397&view=rev
Log:
Fix comparison between pointer and zero character

See hrm Bug #657309

Modified:
    branches/S2_6/client/gui-sdl/gui_string.c
    branches/S2_6/client/gui-sdl2/gui_string.c

Modified: branches/S2_6/client/gui-sdl/gui_string.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-sdl/gui_string.c?rev=35397&r1=35396&r2=35397&view=diff
==============================================================================
--- branches/S2_6/client/gui-sdl/gui_string.c   (original)
+++ branches/S2_6/client/gui-sdl/gui_string.c   Fri May  5 07:51:25 2017
@@ -94,13 +94,13 @@
 SDL_Rect str16size(SDL_String16 *pString16)
 {
   SDL_Rect Ret = {0, 0, 0, 0};
-  
-  if (pString16 && pString16->text && pString16->text != '\0') {
+
+  if (pString16 && pString16->text && pString16->text[0] != '\0') {
     Uint16 *pStr16 = pString16->text;
     Uint16 c = *pStr16;
     bool new_line = FALSE;
     int w, h;
-    
+
     /* find '\n' */
     while (c != '\0') {
       if (c == 10) {

Modified: branches/S2_6/client/gui-sdl2/gui_string.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-sdl2/gui_string.c?rev=35397&r1=35396&r2=35397&view=diff
==============================================================================
--- branches/S2_6/client/gui-sdl2/gui_string.c  (original)
+++ branches/S2_6/client/gui-sdl2/gui_string.c  Fri May  5 07:51:25 2017
@@ -98,7 +98,7 @@
 **************************************************************************/
 void utf8_str_size(utf8_str *pstr, SDL_Rect *fill)
 {
-  if (pstr != NULL && pstr->text != NULL && pstr->text != '\0') {
+  if (pstr != NULL && pstr->text != NULL && pstr->text[0] != '\0') {
     char *current = pstr->text;
     char c = *current;
     bool new_line = FALSE;


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to