Changeset 725 for cpp


Ignore:
Timestamp:
01/17/18 01:52:37 (7 years ago)
Author:
Maciej Komosinski
Message:

Fix crash when no data provided

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/_demos/paramtree_stdin_test.cpp

    r724 r725  
    1313                ParamEntry zero_ending = { 0, 0, 0, 0 };
    1414                entries.push_back(zero_ending);
     15                setParamTab(getParamTab());
    1516        }
    1617        void addGroup(const char* name)
     
    3233{
    3334        SString group_names;
    34         StdioFILE::setStdio();//setup VirtFILE::Vstdin/out/err
     35        StdioFILE::setStdio(); //setup VirtFILE::Vstdin/out/err
     36        puts("(loading group names from stdin)");
    3537        loadSString(VirtFILE::Vstdin, group_names);
    3638        int pos = 0;
    3739        SString line;
    3840        EmptyParamWithGroupsForTesting param;
    39         puts("(loading group names from stdin)");
    4041        while (group_names.getNextToken(pos, line, '\n'))
    4142        {
    4243                if ((line.len() > 0) && (line[line.len() - 1] == '\r')) //support for reading \r\n files...
    4344                        line = line.substr(0, line.len() - 1);
    44                 if (line.len() > 0 && line[0] != '#') // skip empty lines and #commment lines
     45                if (line.len() > 0 && line[0] != '#') //skip empty lines and #commment lines
    4546                        param.addGroup(line.c_str());
    4647        }
Note: See TracChangeset for help on using the changeset viewer.