Skip to content

Commit 43a68dc

Browse files
committed
NIFs: fix "warning: initializer-string for character array is too long"
array size is 64 but initializer has size 65 (including the null terminating character). Keep it 64 by using the array syntax, instead of "". Signed-off-by: Davide Bettio <davide@uninstall.it>
1 parent d7ad297 commit 43a68dc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/libAtomVM/nifs.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4163,7 +4163,13 @@ static term nif_console_print(Context *ctx, int argc, term argv[])
41634163
return OK_ATOM;
41644164
}
41654165

4166-
static char b64_table[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
4166+
static char b64_table[64] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
4167+
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
4168+
'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd',
4169+
'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
4170+
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
4171+
'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7',
4172+
'8', '9', '+', '/'};
41674173

41684174
// per https://tools.ietf.org/rfc/rfc4648.txt
41694175

0 commit comments

Comments
 (0)