From: <dhu...@us...> - 2007-02-14 17:44:01
|
Revision: 322 http://svn.sourceforge.net/qcell/?rev=322&view=rev Author: dhubleizh Date: 2007-02-14 09:43:57 -0800 (Wed, 14 Feb 2007) Log Message: ----------- - FQT doesn't allow to big values to get loaded Modified Paths: -------------- trunk/qcell/parsers/FQT/FQTParserPlugin.cpp Modified: trunk/qcell/parsers/FQT/FQTParserPlugin.cpp =================================================================== --- trunk/qcell/parsers/FQT/FQTParserPlugin.cpp 2007-02-14 17:13:48 UTC (rev 321) +++ trunk/qcell/parsers/FQT/FQTParserPlugin.cpp 2007-02-14 17:43:57 UTC (rev 322) @@ -158,7 +158,7 @@ } // Now we can calculate the maximal sum value max_sum = arg_nr * (values_nr - 1); - free_args_columns = pow(values_nr, (arguments_nr - arg_nr)); + free_args_columns = pow(return_values_nr, (arguments_nr - arg_nr)); lines.removeFirst(); line_nr++; @@ -231,18 +231,7 @@ { // Keep track of current parsed value value_index++; - // Sanity check for value - if((int)value.toAscii() >= ((int)'A' + (return_values_nr-10))) - { - qDebug(tr("The value number %1 in line %2 is larger then the maximum declared in the header.") - .arg(value_index) - .arg(line_nr) - .toAscii() - ); - return QString(); - } - // Collecting this lines values tmp_sign = (int)value.toAscii(); if(tmp_sign >= (int)'A') @@ -254,9 +243,20 @@ { tmp_values.append(tmp_sign - (int)'0'); } + + // Sanity check for value + if(tmp_values.last()>= return_values_nr) + { + qDebug(tr("The value number %1 in line %2 is larger then the maximum declared in the header.") + .arg(value_index) + .arg(line_nr) + .toAscii() + ); + + return QString(); + } } - // Finally adding the parsed values results[tmp_sum] = QVector<int>(tmp_values); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |