[vtk-developers] simple VTKDataReader compiler warning

Sean McBride sean at rogue-research.com
Fri Sep 14 10:27:13 EDT 2007


Hi everyone,

VTKDataReader.cxx has this piece of code:

     char nameOfAttribute[256];
     sscanf(line, "%*s %s", nameOfAttribute);
     if ( nameOfAttribute )
       {
       array[num-1] = new char [strlen(nameOfAttribute)+1];
       strcpy(array[num-1],nameOfAttribute);
       }
     }//found one

The 'if' always evaluates to true, and causes a warning.

Anyone know for sure what the code should be doing?  Maybe 'if
(strlen(nameOfAttribute))'?

Thanks,

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada





More information about the vtk-developers mailing list