32 lines
647 B
Diff
32 lines
647 B
Diff
Description: initialize encoder/decoder state in the constructors
|
|
Author: Jakub Wilk <jwilk@debian.org>
|
|
Forwarded: no
|
|
Last-Update: 2013-01-11
|
|
|
|
--- a/include/b64/decode.h
|
|
+++ b/include/b64/decode.h
|
|
@@ -25,7 +25,9 @@ namespace base64
|
|
|
|
decoder(int buffersize_in = BUFSIZ)
|
|
: _buffersize(buffersize_in)
|
|
- {}
|
|
+ {
|
|
+ base64_init_decodestate(&_state);
|
|
+ }
|
|
|
|
int decode(char value_in)
|
|
{
|
|
--- a/include/b64/encode.h
|
|
+++ b/include/b64/encode.h
|
|
@@ -25,7 +25,9 @@ namespace base64
|
|
|
|
encoder(int buffersize_in = BUFSIZ)
|
|
: _buffersize(buffersize_in)
|
|
- {}
|
|
+ {
|
|
+ base64_init_encodestate(&_state);
|
|
+ }
|
|
|
|
int encode(char value_in)
|
|
{
|