]> Kevux Git Server - fll/commit
Bugfix: Failed to produce identical binary when passing appropriate parameters.
authorKevin Day <thekevinday@gmail.com>
Sat, 11 Dec 2021 20:54:11 +0000 (14:54 -0600)
committerKevin Day <thekevinday@gmail.com>
Sat, 11 Dec 2021 20:54:11 +0000 (14:54 -0600)
commit476bc6974555b789db1c4ed1344976748da69213
treef291cab4945b3553693611ba342de1fbaad74ca4
parent6d7754d80e1d555a413902a5e0c76a7fbec96191
Bugfix: Failed to produce identical binary when passing appropriate parameters.

Taking a binary input with a binary output while passing +nq should result in a byte-for-byte duplicate binary.

Example: "utf8 -f /bin/bash -bB +nq -F /tmp/bash".

This is failing for two reasons:
1) Not using the original string data when printing detected invalid characters.
2) Performing the from codepoint check before checking the binary output check in the function utf8_print_character().

Also remove a redundant not zero check in the error print function utf8_print_character_invalid().
the function utf8_print_character_invalid() is a wrapper to utf8_print_character(), where that check is already performed.
level_3/utf8/c/private-print.c
level_3/utf8/c/private-utf8_binary.c
level_3/utf8/c/private-utf8_codepoint.c