-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Custom strndupa: Convert it to a macro instead of a function (#385)
* Custom strndupa: Convert it to a macro instead of a function Looking at https://www.gnu.org/software/libc/manual/html_node/Truncating-Strings.html , strndupa is implemented as a macro. It uses malloca, which allocates space in the stack frame of the caller. The temporary space is automatically freed when the function that called alloca returns. * Remove extra () from strndupa macro
- Loading branch information
1 parent
a5f87a5
commit 6947d6b
Showing
2 changed files
with
18 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters