]> Kevux Git Server - fll/commit
Bugfix: Last character of file after conversion from code point is not printed by...
authorKevin Day <thekevinday@gmail.com>
Sat, 11 Jun 2022 19:09:39 +0000 (14:09 -0500)
committerKevin Day <thekevinday@gmail.com>
Sat, 11 Jun 2022 19:09:39 +0000 (14:09 -0500)
commita4e63c1483a32356f32174c9b396fcbd5e554f7d
tree4db26ce3f3e4331797e975442c3c5e4c9b22e455
parent81857c9f94c091480d1346f98b4d26fab38e4c4a
Bugfix: Last character of file after conversion from code point is not printed by utf8 program.

The algorithm doesn't print the character until it knows when the character is complete.
There are no checks for when end of file is reached.
This results in the last character not being printed, even if the code is complete.

Be sure to return the status rather than always returning F_none under certain circumstances in utf8_detect_codepoint().
Update documentation about return value in utf8_detect_codepoint().
Initialize the character.used to 0 rather than 4 (because it has no data!).
For better practice, compare using >= rather than ==.
Remove unnecessary i = 0 assignment.
level_3/utf8/c/private-utf8_codepoint.c
level_3/utf8/c/private-utf8_codepoint.h