From 517dfff529991737a6042f7a79b44d4738f4d1e9 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Mon, 5 May 2025 18:21:00 -0700 Subject: [PATCH] Use bool instead of int flag in FTP analyzer's parse_eftp method --- src/analyzer/protocol/ftp/functions.bif | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/analyzer/protocol/ftp/functions.bif b/src/analyzer/protocol/ftp/functions.bif index d562375ecb..5af6346b93 100644 --- a/src/analyzer/protocol/ftp/functions.bif +++ b/src/analyzer/protocol/ftp/functions.bif @@ -49,7 +49,7 @@ static zeek::RecordValPtr parse_eftp(const char* line) int net_proto = 0; // currently not used zeek::IPAddr addr; // unspecified IPv6 address (all 128 bits zero) int port = 0; - int good = 0; + bool good = false; if ( line ) { @@ -61,12 +61,12 @@ static zeek::RecordValPtr parse_eftp(const char* line) if ( *line ) { - good = 1; + good = true; ++line; // skip delimiter net_proto = strtol(line, &next_delim, 10); if ( *next_delim != delimiter ) - good = 0; + good = false; line = next_delim; if ( *line ) @@ -78,7 +78,7 @@ static zeek::RecordValPtr parse_eftp(const char* line) if ( nptr == NULL ) { nptr = line + strlen(line); - good = 0; + good = false; } std::string s(line, nptr-line); // extract IP address @@ -95,12 +95,12 @@ static zeek::RecordValPtr parse_eftp(const char* line) ++line; // now the port port = strtol(line, &next_delim, 10); if ( *next_delim != delimiter ) - good = 0; + good = false; if ( port < 0 || port > 65535 ) { port = 0; - good = 0; + good = false; } } }