-
Notifications
You must be signed in to change notification settings - Fork 461
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
compat: strnlen impl. if not present #1983
Conversation
success |
lib/compat/strnlen.c
Outdated
|
||
#if !SYSLOG_NG_HAVE_STRNLEN | ||
|
||
#include <stdint.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to man 3 memchr, memchr is included from string.h, which is included from compat/string.h. Do we need this include?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not included because of the memchr
, that is guaranteed to be included for the reason you stated above.
And I totally meant stddef.h
not stdint.h
:), that is needed for size_t
. I guess the stddef.h
is included at some place either way.
success |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Signed-off-by: kokan <peter.kokai@balabit.com>
success |
Implements
strnlen
if it is missing from thestring.h
header.@pryankster please test this
Fixes #1982