mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Merge remote-tracking branch 'origin/topic/jsiwek/strings-bif-warnings'
* origin/topic/jsiwek/strings-bif-warnings: Misc strings.bif adjustments
This commit is contained in:
commit
f7bec7d7ef
3 changed files with 12 additions and 5 deletions
7
CHANGES
7
CHANGES
|
@ -1,3 +1,10 @@
|
||||||
|
3.3.0-dev.119 | 2020-08-19 14:35:51 -0700
|
||||||
|
|
||||||
|
* Misc strings.bif adjustments
|
||||||
|
|
||||||
|
* Declare rfind_str() with correct return type
|
||||||
|
* Fix compiler warnings for signed/unsigned comparisons (Jon Siwek, Corelight)
|
||||||
|
|
||||||
3.3.0-dev.117 | 2020-08-19 14:12:06 -0700
|
3.3.0-dev.117 | 2020-08-19 14:12:06 -0700
|
||||||
|
|
||||||
* Use constexpr for IPAddr::v4_mapped_prefix declaration
|
* Use constexpr for IPAddr::v4_mapped_prefix declaration
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
3.3.0-dev.117
|
3.3.0-dev.119
|
||||||
|
|
|
@ -1181,7 +1181,7 @@ function count_substr%(str: string, sub: string%) : count
|
||||||
|
|
||||||
%%{
|
%%{
|
||||||
|
|
||||||
int64_t do_find_str(zeek::StringVal* str, zeek::StringVal* sub, uint64_t start, int64_t end, bool rfind)
|
static int64_t do_find_str(zeek::StringVal* str, zeek::StringVal* sub, int64_t start, int64_t end, bool rfind)
|
||||||
{
|
{
|
||||||
// Don't bother if the start is after the end of the string.
|
// Don't bother if the start is after the end of the string.
|
||||||
if ( start > str->Len() )
|
if ( start > str->Len() )
|
||||||
|
@ -1194,7 +1194,7 @@ int64_t do_find_str(zeek::StringVal* str, zeek::StringVal* sub, uint64_t start,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t end_pos = str->Len();
|
int64_t end_pos = str->Len();
|
||||||
if ( end >= 0 && end < str->Len() )
|
if ( end >= 0 && end < str->Len() )
|
||||||
end_pos = end;
|
end_pos = end;
|
||||||
|
|
||||||
|
@ -1247,7 +1247,7 @@ function find_str%(str: string, sub: string, start: count &default=0, end: int &
|
||||||
## Returns: The position of the substring. Returns -1 if the string wasn't found. Prints an error if the
|
## Returns: The position of the substring. Returns -1 if the string wasn't found. Prints an error if the
|
||||||
## starting position is after the ending position.
|
## starting position is after the ending position.
|
||||||
##
|
##
|
||||||
function rfind_str%(str: string, sub: string, start: count &default=0, end: int &default=-1%) : count
|
function rfind_str%(str: string, sub: string, start: count &default=0, end: int &default=-1%) : int
|
||||||
%{
|
%{
|
||||||
return zeek::val_mgr->Int(do_find_str(str, sub, start, end, true));
|
return zeek::val_mgr->Int(do_find_str(str, sub, start, end, true));
|
||||||
%}
|
%}
|
||||||
|
@ -1340,7 +1340,7 @@ function ljust%(str: string, width: count, fill: string &default=" "%) : string
|
||||||
|
|
||||||
%%{
|
%%{
|
||||||
|
|
||||||
static zeek::StringValPtr do_rjust(zeek::StringVal* str, int width, char fill)
|
static zeek::StringValPtr do_rjust(zeek::StringVal* str, uint64_t width, char fill)
|
||||||
{
|
{
|
||||||
string new_s = str->ToStdString();
|
string new_s = str->ToStdString();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue