[PR #362] +1 byte for the NUL-terminator #720

Open
opened 2026-01-29 15:14:47 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/TheAlgorithms/C/pull/362

State: closed
Merged: Yes


Fixed a critical flaw where strcpy would 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

**Original Pull Request:** https://github.com/TheAlgorithms/C/pull/362 **State:** closed **Merged:** Yes --- Fixed a critical flaw where `strcpy` would 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
claunia added the pull-request label 2026-01-29 15:14:47 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#720