[mythtv-commits] Ticket #7154: [PATCH] Check the return value of function calls inside of libmythtv
MythTV
noreply at mythtv.org
Tue May 17 19:57:47 UTC 2011
#7154: [PATCH] Check the return value of function calls inside of libmythtv
---------------------------------------------+---------------------------
Reporter: Erik Hovland <erik@…> | Owner: danielk
Type: Patch - Bug Fix | Status: closed
Priority: trivial | Milestone: unknown
Component: MythTV - General | Version: head
Severity: low | Resolution: Won't Fix
Keywords: | Ticket locked: 0
---------------------------------------------+---------------------------
Changes (by danielk):
* status: assigned => closed
* resolution: => Won't Fix
Comment:
Most of these change some crufty database code of the form:
{{{
if (query.size() <= 0)
return -1;
query.next();
return query.value(0).toInt();
}}}
to
{{{
if (query.size() <= 0)
return -1;
if (!query.next())
return -1;
return query.value(0).toInt();
}}}
But really the code should be of the form:
{{{
if (!query.next())
return -1;
return query.value(0).toInt();
}}}
Since the original code will work whenever size() is supported and the
patched code will still fail when it isn't I'm just going to stick with
the original code.
--
Ticket URL: <http://code.mythtv.org/trac/ticket/7154#comment:3>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center
More information about the mythtv-commits
mailing list