Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
print_lines: fix bugs in line length calculation
1) The loop for determining the line length read from a character offset before checking whether the offset is smaller than the given string length. This could have caused access outside the string buffer. 2) The routine for determining the line length first seeked for the offset of the last real character of the line and than added one for getting the length but only if the following character was '\n'. This has to be done for any other line-terminating character too. The only case where you don't want to do this is when the end of the whole string is reached. Issue genodelabs#2967
- Loading branch information