mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-05-10 00:49:04 +08:00
Refactor while loop for simplicity
Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
parent
ada7d72447
commit
25d65e8527
@ -915,14 +915,13 @@ static int oid_parse_number(unsigned int *num, const char **p, const char *bound
|
|||||||
|
|
||||||
static size_t oid_subidentifier_num_bytes(unsigned int value)
|
static size_t oid_subidentifier_num_bytes(unsigned int value)
|
||||||
{
|
{
|
||||||
size_t num_bytes = 1;
|
size_t num_bytes = 0;
|
||||||
|
|
||||||
value >>= 7;
|
do {
|
||||||
|
|
||||||
while (value != 0) {
|
|
||||||
num_bytes++;
|
|
||||||
value >>= 7;
|
value >>= 7;
|
||||||
}
|
num_bytes++;
|
||||||
|
} while (value != 0);
|
||||||
|
|
||||||
return num_bytes;
|
return num_bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user