diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-08-22 17:14:36 +0200 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2021-08-22 17:53:21 +0200 |
commit | 5dec9475bb0d95e7bc129124f94944b9703b28fa (patch) | |
tree | 11d6ad36c386f0c9b214f54f2fb7b2d14ed03c09 | |
parent | c3746dc9012165720bf4bec06d653d69d6bbe355 (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; \ |