Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@shtrophic
Copy link

@shtrophic shtrophic commented Apr 13, 2025

Hi,

this patch "adds support" for OpenBSD. That is: this patch fixes warnings that pop up when compiling there, as strcpy, sprintf and random() have safer replacements.

For linux, this adds a dependency on libbsd, but I don't think that's an issue since it is widely available.

@Aanok
Copy link
Owner

Aanok commented Apr 26, 2025

Hi! Thanks for the proposal :)
I do appreciate a good bit of compiler pedantry but honestly I think I would prefer to avoid adding a dependency just for that. Could we just use strncpy instead of strlcopy and replace random with a macro that dispatches to the BSD-approved variant on BSD?

@shtrophic
Copy link
Author

shtrophic commented Apr 27, 2025

Actually, I've double-checked and strlcpy is part of glibc since 2.38. Same goes for arc4random (2.36). So there is no need for libbsd.

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.

2 participants