aboutsummaryrefslogtreecommitdiff
path: root/b32.c
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-08-20 22:04:25 +0200
committerThomas Voss <mail@thomasvoss.com> 2023-08-20 22:04:25 +0200
commitde3d878243988d150e496750595b3f6b08e17483 (patch)
tree22068b344d04a82ba1399062982800ca421b971b /b32.c
parent9c1a1cfc44d5ce808e1d2128ab6404927331f3c5 (diff)
Make the ‘b32toa’ dest a uint8_t*
Diffstat (limited to 'b32.c')
-rw-r--r--b32.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/b32.c b/b32.c
index 1503bf5..1c50aa5 100644
--- a/b32.c
+++ b/b32.c
@@ -22,7 +22,7 @@ static const uint8_t ctov[] = {
};
bool
-b32toa(char *dst, const char *src, size_t len)
+b32toa(uint8_t *dst, const char *src, size_t len)
{
char c;
size_t pad = 0;
@@ -37,7 +37,7 @@ b32toa(char *dst, const char *src, size_t len)
for (size_t j = 0; j < 8; j++) {
c = src[i + j];
vs[j] = ctov[(uint8_t)c];
- if (vs[j] == 255) {
+ if (vs[j] == (uint8_t)-1) {
if (c == '=' && j >= 8 - pad)
vs[j] = 0;
else