diff options
author | pommicket <pommicket@gmail.com> | 2023-03-23 16:18:38 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-03-23 16:18:38 -0400 |
commit | af61b9be6a746421a0417d282134491213f2c03f (patch) | |
tree | b81b5fe297cc2d4f029ec111b9ac6a9228b1c4f8 /util.h | |
parent | 6643ff4c14cc27bf80189aadaf65c36ac2e7307f (diff) |
handle various :increment-number edge cases and binary
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -98,6 +98,8 @@ void strn_cpy(char *dst, size_t dst_sz, const char *src, size_t src_len); void str_cpy(char *dst, size_t dst_sz, const char *src); /// equivalent to GNU function asprintf (like sprintf, but allocates the string with malloc). char *a_sprintf(const char *fmt, ...); +/// convert binary number to string. make sure `s` can hold at least 65 bytes!! +void str_binary_number(char s[65], u64 n); /// print some bytes. useful for debugging. void print_bytes(const u8 *bytes, size_t n); /// like strstr, but case-insensitive |