[mythtv-commits] Ticket #4312: literal string compare issues (found with gcc-4.3)

MythTV mythtv at cvs.mythtv.org
Wed Dec 12 01:03:34 UTC 2007


#4312: literal string compare issues (found with gcc-4.3)
------------------------+---------------------------------------------------
 Reporter:  ro at suse.de  |       Owner:  ijr    
     Type:  defect      |      Status:  new    
 Priority:  minor       |   Milestone:  unknown
Component:  mythtv      |     Version:  head   
 Severity:  medium      |     Mlocked:  0      
------------------------+---------------------------------------------------
 up to now I found three string compare issues in the mythtv code:

 this one should probably get a shorter solution:
 --- libs/libmythtv/tv_rec.cpp
 +++ libs/libmythtv/tv_rec.cpp
 @@ -2109,7 +2109,7 @@
          for (uint j = 0; j < kSpacerListSize; j++)
          {
             QString qprefix = add_spacer(
 -                prefix, (spacers[j] == "_") ? "\\_" : spacers[j]);
 +                prefix, (!strcmp(spacers[j],"_")) ? "\\_" : spacers[j]);
              query.prepare(basequery.arg(qprefix) + cardquery[i]);

              if (!query.exec() || !query.isActive())


 at least the first of the following two will probably not even have worked
 before:
 --- libs/libmyth/managedlist.cpp
 +++ libs/libmyth/managedlist.cpp
 @@ -290,7 +290,7 @@
      if (!item)
          return false;

 -    if (item->name() == "unnamed")
 +    if (!strcmp(item->name(),"unnamed"))
          item->setName( QString( "ITEM-%1").arg(itemList.count()));

      if (!child(item->name()) && !item->parent())
 --- libs/libmythtv/xine_demux_sputext.c
 +++ libs/libmythtv/xine_demux_sputext.c
 @@ -676,7 +676,7 @@
    sub_readtext((char *) &line,&current->text[1]);
    current->lines = 2;

 -  if ((current->text[0]=="") && (current->text[1]=="")) {
 +  if (!strlen(current->text[0]) && !strlen(current->text[1])) {
      return NULL;
    }

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/4312>
MythTV <http://svn.mythtv.org/trac>
MythTV


More information about the mythtv-commits mailing list