Opened 13 years ago
Closed 13 years ago
#4312 closed defect (fixed)
literal string compare issues (found with gcc-4.3)
Reported by: | Owned by: | danielk | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | mythtv | Version: | head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
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,¤t->text[1]); current->lines = 2;
+ if (!strlen(current->text[0]) && !strlen(current->text[1])) {
return NULL;
}
Attachments (2)
Change History (5)
Changed 13 years ago by
Attachment: | mythtv-stringcompare.dif added |
---|
comment:1 Changed 13 years ago by
Owner: | changed from Isaac Richards to danielk |
---|---|
Status: | new → assigned |
Changed 13 years ago by
Attachment: | mythtv-stringliteral.dif added |
---|
comment:2 Changed 13 years ago by
comment:3 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
attached the diffs as files, cut'n'paste didn't work so good ...