Skip to content

Commit 46ae080

Browse files
authored
Merge pull request #5 from SPauly/iss4
fixed bug in issue #4
2 parents 60e1119 + 8459b3a commit 46ae080

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

GetIntoCPPAgain.exe

1.09 KB
Binary file not shown.

src/CSVParser.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ namespace csv
88
m_StartIterator = 0;
99
m_ItemIteratorPos = 0;
1010

11-
while((m_ItemIteratorPos = _row.find_first_of(',', m_StartIterator) != std::string::npos)){
12-
m_data.push_back(_row.substr(m_StartIterator - m_ItemIteratorPos));
11+
do
12+
{
13+
m_ItemIteratorPos = _row.find_first_of(",", m_StartIterator);
14+
m_data.push_back(_row.substr(m_StartIterator, m_ItemIteratorPos-m_StartIterator));
1315
m_StartIterator = m_ItemIteratorPos + 1;
14-
}
15-
16+
} while (m_ItemIteratorPos != std::string::npos);
17+
1618
};
1719

1820
Row::~Row(){};

0 commit comments

Comments
 (0)