Skip to content
Snippets Groups Projects
Commit 1c442616 authored by rswindell's avatar rswindell
Browse files

Encode/decode functions auto-strlen() if passed 0 for source length.

parent f4c7c891
No related branches found
No related tags found
No related merge requests found
......@@ -52,6 +52,8 @@ int b64_decode(char *target, size_t tlen, const char *source, size_t slen)
int working=0;
char * i;
if(slen==0)
slen=strlen(source);
outp=target;
inp=source;
outend=target+tlen;
......@@ -102,6 +104,8 @@ int b64_encode(char *target, size_t tlen, const char *source, size_t slen) {
char enc;
int buf=0;
if(slen==0)
slen=strlen(source);
inp=source;
if(source==target) {
tmpbuf=(char *)malloc(tlen);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment