summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-08-22 17:14:36 +0200
committerBenBE <BenBE@geshi.org>2021-08-22 17:53:21 +0200
commit5dec9475bb0d95e7bc129124f94944b9703b28fa (patch)
tree11d6ad36c386f0c9b214f54f2fb7b2d14ed03c09
parentc3746dc9012165720bf4bec06d653d69d6bbe355 (diff)
Use break inside loop with false condition
Found by clang-tidy. home/christian/Coding/workspaces/htop/Process.c:505:13: warning: 'continue' in loop with false condition is equivalent to 'break' [bugprone-terminating-continue] WRITE_HIGHLIGHT(0, strlen(procComm), commAttr, CMDLINE_HIGHLIGHT_FLAG_COMM); ^ /home/christian/Coding/workspaces/htop/Process.c:461:13: note: expanded from macro 'WRITE_HIGHLIGHT' continue; \ ^
-rw-r--r--Process.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Process.c b/Process.c
index d359c005..b28f8c1d 100644
--- a/Process.c
+++ b/Process.c
@@ -458,7 +458,7 @@ void Process_makeCommandStr(Process* this) {
/* Check if we still have capacity */ \
assert(mc->highlightCount < ARRAYSIZE(mc->highlights)); \
if (mc->highlightCount >= ARRAYSIZE(mc->highlights)) \
- continue; \
+ break; \
\
mc->highlights[mc->highlightCount].offset = str - strStart + (_offset) - mbMismatch; \
mc->highlights[mc->highlightCount].length = _length; \

© 2014-2024 Faster IT GmbH | imprint | privacy policy