]> The Tcpdump Group git mirrors - libpcap/commitdiff
Make qerr const.
authorGuy Harris <[email protected]>
Fri, 26 Oct 2018 20:02:59 +0000 (13:02 -0700)
committerGuy Harris <[email protected]>
Fri, 26 Oct 2018 20:02:59 +0000 (13:02 -0700)
It's not something we're allowed to modify, as that could fail if two or
more threads are all running in pcap_compile(); declare it as const to
make sure we don't modify it.

grammar.y

index e060cdea841b5ac3cb1e3e2d8c416a78108b7412..3eeb135c8b23ecbd312bf4786612f0fb70c89430 100644 (file)
--- a/grammar.y
+++ b/grammar.y
@@ -237,7 +237,7 @@ str2tok(const char *str, const struct tok *toks)
        return (-1);
 }
 
-static struct qual qerr = { Q_UNDEF, Q_UNDEF, Q_UNDEF, Q_UNDEF };
+static const struct qual qerr = { Q_UNDEF, Q_UNDEF, Q_UNDEF, Q_UNDEF };
 
 static PCAP_NORETURN_DEF void
 yyerror(void *yyscanner _U_, compiler_state_t *cstate, const char *msg)