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

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

📋 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: masterHead: 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 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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/TheAlgorithms/C/pull/362 **Author:** [@Spikatrix](https://github.com/Spikatrix) **Created:** 10/6/2019 **Status:** ✅ Merged **Merged:** 10/6/2019 **Merged by:** [@danghai](https://github.com/danghai) **Base:** `master` ← **Head:** `patch-3` --- ### 📝 Commits (1) - [`681bfab`](https://github.com/TheAlgorithms/C/commit/681bfabed2b82349f0a6a0562b37dd29c449d44e) +1 byte for the NUL-terminator ### 📊 Changes **1 file changed** (+7 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `exercism/hello-world/hello_world.c` (+7 -5) </details> ### 📄 Description 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 15:14:45 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#715