]> The Tcpdump Group git mirrors - tcpdump/blobdiff - instrument-functions.c
Update the GitHub issue template
[tcpdump] / instrument-functions.c
index 350a1682a0326f9a058e2f7369ff5320dcc01ce1..ba0a56a5309ff572e6a94d24c2d3d7c7ec31ef74 100644 (file)
@@ -74,13 +74,13 @@ 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 ? */
@@ -140,7 +140,7 @@ static void print_debug(void *this_fn, void *call_site, action_type action)
                        return;
                }
 
-               symtab = (asymbol **)malloc(symsize);
+               symtab = (asymbol **)malloc((size_t)symsize);
                symcount = bfd_canonicalize_symtab(abfd, symtab);
                if (symcount < 0) {
                        free(symtab);
@@ -158,6 +158,7 @@ static void print_debug(void *this_fn, void *call_site, action_type action)
        if (instrument_global) {
                symbol_info syminfo;
                int found;
+               long i;
 
                i = 0;
                found = 0;
@@ -185,6 +186,8 @@ static void print_debug(void *this_fn, void *call_site, action_type action)
                                                                   &file, &func, &line)) {
                        printf("[ERROR bfd_find_nearest_line this_fn]");
                } else {
+                       int i;
+
                        if (action == ENTER)
                                profile_func_level += 1;
                        /* Indentation */