Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strcpy #30

Closed
wants to merge 3 commits into from
Closed

Strcpy #30

wants to merge 3 commits into from

Conversation

arnopo
Copy link
Owner

@arnopo arnopo commented Sep 30, 2024

No description provided.

The strlcpy() function has only recently become available in glibc.
To ensure compatibility with legacy libc versions, this commit
implements an internal version of strlcpy().

The function has been adapted from the FreeBSD implementation to
fit our needs.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
The strncpy function does not ensure that the destination string is
null-terminated. To address this issue, replace strncpy with the
internal strlcpy function, which guarantees null-termination of the
destination string.

Note: (void)strlcpy(...) indicates that the return value is intentionally
ignored.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
The strncpy function does not ensure that the destination string is
null-terminated. To address this issue, replace strncpy with the
internal strlcpy function, which guarantees null-termination of the
destination string.

Note: (void)strlcpy(...) indicates that the return value is intentionally
ignored.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant