-
-
Save kaspar030/06d9b04ed210aed79d42bd4bba885298 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| commit 25b453fd4d354cd16de7ff233da626758c6ab1be | |
| Author: Kaspar Schleiser <kaspar@schleiser.de> | |
| Date: Wed Jan 10 14:53:55 2018 +0100 | |
| fixup! sys/fmt: add new byte to hex converters: | |
| diff --git a/sys/fmt/fmt.c b/sys/fmt/fmt.c | |
| index 3d333195e..36540a545 100644 | |
| --- a/sys/fmt/fmt.c | |
| +++ b/sys/fmt/fmt.c | |
| @@ -64,11 +64,11 @@ size_t fmt_byte_hex(char *out, uint8_t byte) | |
| size_t fmt_bytes_hex(char *out, const uint8_t *ptr, size_t n) | |
| { | |
| - size_t len = 0; | |
| + size_t len = n * 2; | |
| + | |
| if (out) { | |
| while (n--) { | |
| out += fmt_byte_hex(out, *ptr++); | |
| - len += 2; | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment