From: Mike Stepanek (mstepane) Date: Fri, 4 Mar 2022 14:32:23 +0000 (+0000) Subject: Pull request #3298: utils: fix compilation issues in js_tokenizer X-Git-Tag: 3.1.25.0~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=293876666427b8e29caf33ddf9f378f4d3823561;p=thirdparty%2Fsnort3.git Pull request #3298: utils: fix compilation issues in js_tokenizer Merge in SNORT/snort3 from ~VHORBATO/snort3:js_platforms_fix to master Squashed commit of the following: commit 1dcb665ab0353b30d7df6a89e74de3a7ffb47889 Author: Vitalii Date: Fri Mar 4 12:35:30 2022 +0200 utils: fix compilation issues in js_tokenizer --- diff --git a/src/utils/js_tokenizer.h b/src/utils/js_tokenizer.h index 2e8cc6c8a..2dcdc1fe7 100644 --- a/src/utils/js_tokenizer.h +++ b/src/utils/js_tokenizer.h @@ -20,6 +20,7 @@ #ifndef JS_TOKENIZER_H #define JS_TOKENIZER_H +#include #include #include #include diff --git a/src/utils/js_tokenizer.l b/src/utils/js_tokenizer.l index 4439e496e..4e3ff0a2c 100644 --- a/src/utils/js_tokenizer.l +++ b/src/utils/js_tokenizer.l @@ -1783,8 +1783,8 @@ JSTokenizer::FuncType JSTokenizer::detect_func_type() assert(size >= 0); char tail[256]; - assert((long unsigned int)size <= sizeof(tail)); - size = std::min((long unsigned int)size, sizeof(tail)); + assert((size_t)size <= sizeof(tail)); + size = std::min((size_t)size, sizeof(tail)); pbuf->pubseekoff(-size, yyout.cur, yyout.out); pbuf->sgetn(tail, size);