Frederik Schwarzer | 5 Dec 2011 13:10
Picon
Gravatar

A few cppcheck questions

Hi,

cppcheck found a few strange pieces of code I would like to ask
you about.

groupchatdlg.cpp:283
if (!version) {
    dlg->appendSysMsg(QString("No version information available for
%1.").arg(version->jid().resource()) , false);
    return;
}
If 'version' is not defined, ist is dereferenced one line below the check.

libpsi/tools/zip/minizip/miniunz.c:297
char rep;
[...]
if (ftestexist!=NULL)
{
    [...]
    rep = answer[0] ;
}

if (rep == 'N')

'rep' actually can be 'N' here on definition in some rare cases, no?

psiaccount.cpp:4545
void PsiAccount::handleEvent(PsiEvent* e, ActivationType activationType)
{
    if (e && activationType != FromXml) {
(Continue reading)

Rion | 5 Dec 2011 18:17
Picon
Gravatar

Re: A few cppcheck questions

looks like check for 'e' is redundant and should be removed

2011/12/5 Frederik Schwarzer <schwarzerf <at> gmail.com>:
>  if (e && activationType != FromXml) {
>        setEnabled();
>    }
_______________________________________________
Psi-Devel mailing list
Psi-Devel <at> lists.affinix.com
http://lists.affinix.com/listinfo.cgi/psi-devel-affinix.com

Gmane