summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2023-05-04 12:47:27 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2023-05-04 12:47:27 +0200
commit3d9930b78ff77629d52129bedeceba12a2fe2088 (patch)
tree2cf9d59d8abb42720c109ef32e46b6c34f834c3f
parent11bde3533f725884f16d1e5c491eaf53190d3852 (diff)
downloadlibpcap-3d9930b78ff77629d52129bedeceba12a2fe2088.tar.gz
instrument functions: Reduce the scope of a variable
Fix the cppcheck warning: instrument-functions.c:77:15: warning: The scope of the variable 'instrument_type' can be reduced. [variableScope] [skip ci]
-rw-r--r--instrument-functions.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/instrument-functions.c b/instrument-functions.c
index 350a1682..2c1ad332 100644
--- a/instrument-functions.c
+++ b/instrument-functions.c
@@ -74,13 +74,14 @@ static void print_debug(void *this_fn, void *call_site, action_type action)
static long symcount;
static asection *text;
static bfd_vma vma;
- static char *instrument_type;
static int instrument_set;
static int instrument_off;
static int instrument_global;
int i;
if (!instrument_set) {
+ static char *instrument_type;
+
/* Get the configuration environment variable INSTRUMENT value if any */
instrument_type = getenv("INSTRUMENT");
/* unset or set to an empty string ? */