Changeset 3504


Ignore:
Timestamp:
Mar 14, 2013 11:45:20 PM (11 years ago)
Author:
ldelgass
Message:

In VTK reader, don't read ahead once we read lookup table line, also require
lookup table line and reset start pointer before reading lines after point
data header.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/VtkReader.cpp

    r3503 r3504  
    182182                    return NULL;
    183183                }
     184                for (start = line; *start == ' ' || *start == '\t'; start++)
     185                    ;  // skip leading blanks
    184186                if (sscanf(start, "SCALARS %s %s", str, type) != 2) {
    185187                    result.error("Error in data stream");
     
    205207                    return NULL;
    206208                }
    207                 if (sscanf("LOOKUP_TABLE %s", str) == 1) {
    208                     // skip line
     209                for (start = line; *start == ' ' || *start == '\t'; start++)
     210                    ;  // skip leading blanks
     211                if (sscanf(start, "LOOKUP_TABLE %s", str) == 1) {
     212                    // skip lookup table, but don't read ahead
    209213                    if (fin.eof()) {
    210214                        result.error("Error in data stream");
    211215                        return NULL;
    212216                    }
    213                     fin.getline(line, sizeof(line) - 1);
    214                     if (fin.fail()) {
    215                         result.error("Error in data stream");
    216                         return NULL;
    217                     }
     217                } else {
     218                    // Lookup table line is required
     219                    result.error("Missing LOOKUP_TABLE");
     220                    return NULL;
    218221                }
    219222                // found start of field data
Note: See TracChangeset for help on using the changeset viewer.