Fix bug with long words causing infinite loop
This commit is contained in:
parent
89dbfdbfb8
commit
5cead86549
1 changed files with 7 additions and 2 deletions
9
herbe.c
9
herbe.c
|
@ -89,10 +89,15 @@ int main(int argc, char *argv[])
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (body[eols[num_of_lines - 1] + eol] != ' ')
|
int temp = eol;
|
||||||
|
|
||||||
|
while (body[eols[num_of_lines - 1] + eol] != ' ' && eol)
|
||||||
--eol;
|
--eol;
|
||||||
|
|
||||||
eol++;
|
if (eol == 0)
|
||||||
|
eol = temp;
|
||||||
|
else
|
||||||
|
eol++;
|
||||||
|
|
||||||
remainder -= eol;
|
remainder -= eol;
|
||||||
if (eols_size < num_of_lines + 1)
|
if (eols_size < num_of_lines + 1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue