mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-02-09 13:54:34 +00:00
[PR #362] +1 byte for the NUL-terminator #720
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/TheAlgorithms/C/pull/362
State: closed
Merged: Yes
Fixed a critical flaw where
strcpywould write the final NUL-terminator in an invalid location invoking Undefined Behavior. Allocated one extra byte to fix it.Cleaned up the code as well in the process