diff mbox series

[11/25] libselinux: context_new(): drop dead assignment

Message ID 20210503175350.55954-12-cgzones@googlemail.com (mailing list archive)
State Accepted
Headers show
Series libselinux: misc compiler and static analyzer findings | expand

Commit Message

Christian Göttsche May 3, 2021, 5:53 p.m. UTC
The variable `i` is not used inside this loop, and it later
unconditionally set to 0.

Found by clang-analyzer.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 libselinux/src/context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libselinux/src/context.c b/libselinux/src/context.c
index ce425880..b2144c7c 100644
--- a/libselinux/src/context.c
+++ b/libselinux/src/context.c
@@ -37,7 +37,7 @@  context_t context_new(const char *str)
 	}
 	n->current_str = n->component[0] = n->component[1] = n->component[2] =
 	    n->component[3] = 0;
-	for (i = count = 0, p = str; *p; p++) {
+	for (count = 0, p = str; *p; p++) {
 		switch (*p) {
 		case ':':
 			count++;