sxt: base64 padding fixed, warning removed;
This commit is contained in:
parent
90b6c6a178
commit
02fb237932
@ -22,6 +22,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <sxt/base64.h>
|
||||
@ -80,7 +81,7 @@ size_t sxt_b64encode_in(const char *data, char *bdata, size_t data_len)
|
||||
nil = (c + 3) - data_len;
|
||||
len = 0;
|
||||
for(i = 0; i < 3; i++) {
|
||||
if(i < nil) {
|
||||
if(i < nil + 1) {
|
||||
ib[i] = *((unsigned char *)data + (c + i));
|
||||
len++;
|
||||
} else ib[i] = (unsigned char)0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user