Bug 91345 - kregexpeditor: variable "h" is used before its value is set (uninitialised local variable)
Summary: kregexpeditor: variable "h" is used before its value is set (uninitialised lo...
Status: RESOLVED FIXED
Alias: None
Product: kregexpeditor
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Jesper Pedersen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-14 22:45 UTC by Marcin Garski
Modified: 2004-10-15 08:45 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Garski 2004-10-14 22:45:22 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

In kmultiformlistbox-multivisible.cpp file there is section:

for (QWidget *child2 = elms->first(); child2; child2=elms->next()) {
    int h;
    if ( strcmp(child2->name(),"seperator") != 0) {
      h += extra;
      h = child2->sizeHint().height();
    }
    else {
      h = child2->size().height();
    }

    moveChild(child2, 0,yPos);

    child2->resize(maxWidth,h);
    yPos += h;
  }

As you can see:
int h;
if ( strcmp(child2->name(),"seperator") != 0) {
 h += extra;
 h = child2->sizeHint().height();

h is uninitialised but is used in += and then it's replaced by:
child2->sizeHint().height();
Comment 1 Jesper Pedersen 2004-10-15 08:45:48 UTC
Thanks for reporting.
Now I just wish I had time to finish that widget.

Cheers
Jesper.