aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZied Aouini <aouinizied@gmail.com>2022-07-22 20:14:30 +0200
committerZied Aouini <aouinizied@gmail.com>2022-07-22 20:14:30 +0200
commit9d040f63170951266da688551f65b353c8145072 (patch)
tree470afb596b558e19968f5f33b273f08cb6bd38ae
parent52005e88ed9730c605db23573f63ba6a17cd45e5 (diff)
Windows compilation fix.
-rw-r--r--src/include/ndpi_typedefs.h2
-rw-r--r--src/lib/ndpi_utils.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h
index da2be39a3..563a6672b 100644
--- a/src/include/ndpi_typedefs.h
+++ b/src/include/ndpi_typedefs.h
@@ -998,7 +998,7 @@ typedef struct _ndpi_automa {
typedef struct ndpi_str_hash {
unsigned int hash;
void *value;
- u_int8_t private_data[0];
+ u_int8_t private_data[1]; /* Avoid error C2466 */
} ndpi_str_hash;
typedef struct ndpi_proto {
diff --git a/src/lib/ndpi_utils.c b/src/lib/ndpi_utils.c
index 31e5a74d2..7622245d1 100644
--- a/src/lib/ndpi_utils.c
+++ b/src/lib/ndpi_utils.c
@@ -73,9 +73,11 @@ struct pcre_struct {
* Please keep this strcture in sync with
* `struct ndpi_str_hash` in src/include/ndpi_typedefs.h
*/
+
typedef struct ndpi_str_hash_private {
unsigned int hash;
void *value;
+ u_int8_t private_data[1];
UT_hash_handle hh;
} ndpi_str_hash_private;
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L