[Fix] Killed warnings for base64
This commit is contained in:
parent
7cf183ea88
commit
ad212c78d1
@ -3,8 +3,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
// Encode table.
|
// Encode table.
|
||||||
static const char cb64[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstu \
|
static const char cb64[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||||
vwxyz0123456789+/";
|
|
||||||
// Decode table.
|
// Decode table.
|
||||||
#define B64(_) \
|
#define B64(_) \
|
||||||
((_) == 'A' ? 0 \
|
((_) == 'A' ? 0 \
|
||||||
@ -189,13 +188,13 @@ char* base64_encode(size_t* len, char* src, size_t sz) {
|
|||||||
|
|
||||||
// Decode the buffer, same syntax as base64_encode.
|
// Decode the buffer, same syntax as base64_encode.
|
||||||
inline int dec_valid(char inp) {
|
inline int dec_valid(char inp) {
|
||||||
if(cd64[inp] == -1)
|
if(cd64[(int)inp] == -1)
|
||||||
return 0;
|
return 0;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char dec_ch(char inp) {
|
inline char dec_ch(char inp) {
|
||||||
return cd64[inp];
|
return cd64[(int)inp];
|
||||||
}
|
}
|
||||||
|
|
||||||
char* base64_decode(size_t* len, char* src, size_t sz) {
|
char* base64_decode(size_t* len, char* src, size_t sz) {
|
||||||
|
Loading…
Reference in New Issue
Block a user