mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-02-04 05:44:35 +00:00
[PR #362] [MERGED] +1 byte for the NUL-terminator #715
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?
📋 Pull Request Information
Original PR: https://github.com/TheAlgorithms/C/pull/362
Author: @Spikatrix
Created: 10/6/2019
Status: ✅ Merged
Merged: 10/6/2019
Merged by: @danghai
Base:
master← Head:patch-3📝 Commits (1)
681bfab+1 byte for the NUL-terminator📊 Changes
1 file changed (+7 additions, -5 deletions)
View changed files
📝
exercism/hello-world/hello_world.c(+7 -5)📄 Description
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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.