/
index
/
herbe.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
89dbfdb
)
Fix bug with long words causing infinite loop
author
Samuel Dudik
<redacted>
Sun, 2 Aug 2020 17:29:13 +0000
(19:29 +0200)
committer
Samuel Dudik
<redacted>
Sun, 2 Aug 2020 17:29:13 +0000
(19:29 +0200)
herbe.c
patch
|
blob
|
history
diff --git
a/herbe.c
b/herbe.c
index 5bcb0a18a6757d56090e06797acd1e9d62c31cb9..f619c790c72b7efa742bdee56c0b3977e1cf4ea2 100644
(file)
--- a/
herbe.c
+++ b/
herbe.c
@@
-89,10
+89,15
@@
int main(int argc, char *argv[])
break;
}
- while (body[eols[num_of_lines - 1] + eol] != ' ')
+ int temp = eol;
+
+ while (body[eols[num_of_lines - 1] + eol] != ' ' && eol)
--eol;
- eol++;
+ if (eol == 0)
+ eol = temp;
+ else
+ eol++;
remainder -= eol;
if (eols_size < num_of_lines + 1)