From c8758c4f246b88804cb92d2b79f42624e4343ba4 Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Mon, 16 Sep 2013 15:36:18 -0500 Subject: [PATCH] Fix possible (unlikely) use of uninitialized value. Plus two minor refactors/nits. --- src/Func.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Func.cc b/src/Func.cc index 7859e8d2ad..11749a8a9c 100644 --- a/src/Func.cc +++ b/src/Func.cc @@ -281,7 +281,7 @@ Val* BroFunc::Call(val_list* args, Frame* parent) const #ifdef PROFILE_BRO_FUNCTIONS DEBUG_MSG("Function: %s\n", id->Name()); #endif - if ( ! bodies.size() ) + if ( bodies.empty() ) { // Can only happen for events and hooks. assert(Flavor() == FUNC_FLAVOR_EVENT || Flavor() == FUNC_FLAVOR_HOOK); @@ -315,14 +315,14 @@ Val* BroFunc::Call(val_list* args, Frame* parent) const loop_over_list(*args, i) f->SetElement(i, (*args)[i]); - stmt_flow_type flow; + stmt_flow_type flow = FLOW_NEXT; Val* result = 0; if ( sample_logger ) sample_logger->FunctionSeen(this); - for ( unsigned int i = 0; i < bodies.size(); ++i ) + for ( size_t i = 0; i < bodies.size(); ++i ) { if ( sample_logger ) sample_logger->LocationSeen(