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

compat: strnlen impl. if not present #1983

Merged
merged 1 commit into from
Apr 16, 2018
Merged

Conversation

Kokan
Copy link
Collaborator

@Kokan Kokan commented Apr 12, 2018

Implements strnlen if it is missing from the string.h header.

@pryankster please test this

Fixes #1982

@kira-syslogng
Copy link
Contributor

success


#if !SYSLOG_NG_HAVE_STRNLEN

#include <stdint.h>
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@kira-syslogng
Copy link
Contributor

success

@Kokan Kokan changed the title compat: strnlen impl. if not present [WIP] compat: strnlen impl. if not present Apr 12, 2018
Copy link
Collaborator

@bazsi bazsi left a 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>
@Kokan Kokan changed the title [WIP] compat: strnlen impl. if not present compat: strnlen impl. if not present Apr 16, 2018
@kira-syslogng
Copy link
Contributor

success

@lbudai lbudai merged commit a9f3c93 into syslog-ng:master Apr 16, 2018
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.

None yet

6 participants