Bug 91345

Summary: kregexpeditor: variable "h" is used before its value is set (uninitialised local variable)
Product: [Applications] kregexpeditor Reporter: Marcin Garski <mgarski>
Component: generalAssignee: Jesper Pedersen <blackie>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

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.