From 5dec9475bb0d95e7bc129124f94944b9703b28fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Sun, 22 Aug 2021 17:14:36 +0200 Subject: [PATCH] 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; \ ^ --- Process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; \