projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4032a9c
)
BASE64: - By Edward Flick - 0-terminate the transcoded buffer
author
Wilfried Goesgens
<dothebart@citadel.org>
Thu, 2 Jan 2014 23:41:06 +0000
(
00:41
+0100)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Thu, 2 Jan 2014 23:41:06 +0000
(
00:41
+0100)
libcitadel/lib/tools.c
patch
|
blob
|
history
diff --git
a/libcitadel/lib/tools.c
b/libcitadel/lib/tools.c
index d5396191ac293650301d2c3b465a061a54daf077..fa8f1657db46ec35462622c77dcfca53ceb60eb4 100644
(file)
--- a/
libcitadel/lib/tools.c
+++ b/
libcitadel/lib/tools.c
@@
-324,13
+324,14
@@
size_t CtdlEncodeBase64(char *dest, const char *source, size_t sourcelen, int li
dest[destoffset++] = '\r';
dest[destoffset++] = '\n';
}
- return destoffset;
-
- } else {
+ }
+ else {
destoffset = base64_encode_block(source, sourcelen, dest, &_state);
-
return destoffset +
base64_encode_blockend(&(dest[destoffset]), &_state);
+
destoffset +=
base64_encode_blockend(&(dest[destoffset]), &_state);
}
+ dest[destoffset] = 0;
+ return destoffset;
}