OMNeT++/OMNEST Bug Tracker - OMNeT++
View Issue Details
0000290OMNeT++simulation kernelpublic2011-05-03 21:222011-05-05 17:34
jesjones 
andras 
normalmajoralways
resolvedfixed 
4.1 
 
0000290: InifileReader::readLineInto fails for long lines
readLineInto can remove whitespace from the middle of lines that are longer than 512 characters because the loop assumes that it was able to read the entire line.

--- a/src/envir/inifilereader.cc
+++ b/src/envir/inifilereader.cc
@@ -235,7 +235,10 @@ bool InifileReader::readLineInto(std::string& line, FILE *file)
         const char *endBuffer = buffer + strlen(buffer);
         if (buffer==endBuffer) break; // should not happen
         bool eolReached = *(endBuffer-1)=='\n' || *(endBuffer-1)=='\r';
- while (endBuffer>buffer && opp_isspace(*(endBuffer-1))) endBuffer--;
+ if (eolReached)
+ {
+ while (endBuffer>buffer && opp_isspace(*(endBuffer-1))) endBuffer--;
+ }
         line.append(buffer, endBuffer - buffer);
         if (eolReached)
             break;
No tags attached.
Issue History
2011-05-03 21:22jesjonesNew Issue
2011-05-05 17:34andrasNote Added: 0000432
2011-05-05 17:34andrasStatusnew => resolved
2011-05-05 17:34andrasFixed in Version => 4.2b3
2011-05-05 17:34andrasResolutionopen => fixed
2011-05-05 17:34andrasAssigned To => andras

Notes
(0000432)
andras   
2011-05-05 17:34   
Fixed. Thanks for reporting it!