Skip to contentSkip to conversation

lib/oid_registry.c: remove redundant assignment to variable num

PATCH New Colin Ian King 1 participant 1 message Dec 30, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/oid_registry.c: remove redundant assignment to variable num

The variable num is being assigned a value that is never read, it is being re-assigned a value in both paths of the following if statement. The assignment is redundant and can be removed.

Cleans up clang-scan warning:
lib/oid_registry.c:149:3: warning: Value stored to 'num' is never read [deadcode.DeadStores]

                num = 0;
---
 lib/oid_registry.c | 1 -
 1 file changed, 1 deletion(-)
lib/oid_registry.c +0 -1
index e592d48b1974..fe6705cfd780 100644
@@ -146,7 +146,6 @@ int sprint_oid(const void *data, size_t datasize, char *buffer, size_t bufsize)
 	bufsize -= count;
 
 	while (v < end) {
-		num = 0;
 		n = *v++;
 		if (!(n & 0x80)) {
 			num = n;
Signature · 1 line
2.33.1