diff options
| author | Laurent Vivier <lvivier@redhat.com> | 2026-11-19 13:49:16 +0100 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-11-22 22:02:50 +0100 |
| commit | 5fa9ecd998d8c66882dead33c44b53be4316924b (patch) | |
| tree | 71f1c50d1b328edb5bbca6b3abacd0641ff3770a | |
| parent | 0b616b3a7159ee15140feb163579e79e061869ef (diff) | |
| download | passt-5fa9ecd998d8c66882dead33c44b53be4316924b.tar passt-5fa9ecd998d8c66882dead33c44b53be4316924b.tar.gz passt-5fa9ecd998d8c66882dead33c44b53be4316924b.tar.bz2 passt-5fa9ecd998d8c66882dead33c44b53be4316924b.tar.lz passt-5fa9ecd998d8c66882dead33c44b53be4316924b.tar.xz passt-5fa9ecd998d8c66882dead33c44b53be4316924b.tar.zst passt-5fa9ecd998d8c66882dead33c44b53be4316924b.zip | |
cppcheck: Fix scope of the variable 'type_or_state'
Fix following cppcheck 2.22.0 error:
flow.c:289:14: style: The scope of the variable 'type_or_state' can be reduced. [variableScope]
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Fixes: bfbd2deae0c3 ("flow: Handle NULL (unknown) flows in flow logging functions")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
| -rw-r--r-- | flow.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -286,7 +286,6 @@ int flowside_connect(const struct ctx *c, int s, void flow_log__(const struct flow_common *f, int pri, bool perror, bool details, enum flow_state state, const char *fmt, ...) { - const char *type_or_state; int errno_ = errno; char msg[BUFSIZ]; va_list args; @@ -299,6 +298,8 @@ void flow_log__(const struct flow_common *f, int pri, bool perror, bool details, logmsg(!perror, false, pri, "Flow: not found, error: %s", msg); details = false; } else { + const char *type_or_state; + /* Show type if it's set, otherwise the state */ if (f->state < FLOW_STATE_TYPED) type_or_state = FLOW_STATE(f); |
