commit | 25d65e85274b4eb788be1dda8781625ec35dc4a9 | [log] [tgz] |
---|---|---|
author | David Horstmann <david.horstmann@arm.com> | Wed May 31 14:53:07 2023 +0100 |
committer | David Horstmann <david.horstmann@arm.com> | Wed May 31 14:53:07 2023 +0100 |
tree | 4c6b1ac7ca7172e2d62d7ec52cf333ad6d659fab | |
parent | ada7d72447e996b31448af1d8a22fc7bbb8d2261 [diff] [blame] |
Refactor while loop for simplicity Signed-off-by: David Horstmann <david.horstmann@arm.com>
diff --git a/library/oid.c b/library/oid.c index d2efbed..ea1e70b 100644 --- a/library/oid.c +++ b/library/oid.c
@@ -915,14 +915,13 @@ static size_t oid_subidentifier_num_bytes(unsigned int value) { - size_t num_bytes = 1; + size_t num_bytes = 0; - value >>= 7; - - while (value != 0) { - num_bytes++; + do { value >>= 7; - } + num_bytes++; + } while (value != 0); + return num_bytes; }