vsprintf: reduce code size by avoiding extra check
Changes
1 files changed · +2 −1
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| lib/vsprintf.c | modified | +2 | −1 | View file |
lib/vsprintf.c
View filediff --git a/lib/vsprintf.c b/lib/vsprintf.c
index cba2385..4819c3d 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -797,8 +797,9 @@ static char *ip6_compressed_string(char *p, const char *addr)
p = pack_hex_byte(p, hi);
else
*p++ = hex_asc_lo(hi);
+ p = pack_hex_byte(p, lo);
}
- if (hi || lo > 0x0f)
+ else if (lo > 0x0f)
p = pack_hex_byte(p, lo);
else
*p++ = hex_asc_lo(lo);