s = *pStart;
/* start to find the next token */
- while ((s < EndBuffer) && !IsEmptyStr(s))
+ while ((s < EndBuffer) &&
+ (!IsEmptyStr(s)) &&
+ (current_token == 0) )
{
if (*s == separator)
{
++s;
}
- /* did we reach a \0 ? */
- if ((s >= EndBuffer) || IsEmptyStr(s)) {
+ /* did we reach the end? */
+ if ((s > EndBuffer)) {
*pStart = EndBuffer + 1;
}
else {
*pStart = s; /* remember the position for the next run */
- (*pStart) ++; /* move behind the next token separator so
- * we don't see it next time */
}
/* sanitize our extracted token */