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

Fix/missing typedefs and strncasecmp replacement #2009

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/include/ndpi_typedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@
/* Used by both nDPI core and patricia code under third-party */
#include "ndpi_patricia_typedefs.h"

#ifndef NDPI_CFFI_PREPROCESSING
#ifndef u_char
typedef unsigned char u_char;
#endif

#ifndef u_short
typedef unsigned short u_short;
#endif

#ifndef u_int
typedef unsigned int u_int;
#endif
#endif

/* NDPI_LOG_LEVEL */
typedef enum {
NDPI_LOG_ERROR,
Expand Down
3 changes: 2 additions & 1 deletion src/lib/ndpi_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8489,7 +8489,8 @@ char *ndpi_strnstr(const char *s, const char *find, size_t slen) {
/* ****************************************************** */

/*
* Same as ndpi_strnstr but case-insensitive
* Same as ndpi_strnstr but case-insensitive.
* Please note that this function is *NOT* equivalent to strncasecmp().
*/
const char * ndpi_strncasestr(const char *str1, const char *str2, size_t len) {
size_t str1_len = strnlen(str1, len);
Expand Down