aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2009-07-29 23:07:47 +0000
committerMike Buland <eichlan@xagasoft.com>2009-07-29 23:07:47 +0000
commit8551cdd3bbf66d8b7b0fea8aa1e0fbddd86bca47 (patch)
tree7c3b2a593eb10563e2826686eccf647da2b16f67
parent24d46e151326b1b159603442e74540bf87897a53 (diff)
downloadlibbu++-8551cdd3bbf66d8b7b0fea8aa1e0fbddd86bca47.tar.gz
libbu++-8551cdd3bbf66d8b7b0fea8aa1e0fbddd86bca47.tar.bz2
libbu++-8551cdd3bbf66d8b7b0fea8aa1e0fbddd86bca47.tar.xz
libbu++-8551cdd3bbf66d8b7b0fea8aa1e0fbddd86bca47.zip
Decoding now skips whitespace
sweet.
Diffstat (limited to '')
-rw-r--r--src/base64.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/base64.cpp b/src/base64.cpp
index b81d028..f6b8cce 100644
--- a/src/base64.cpp
+++ b/src/base64.cpp
@@ -83,8 +83,18 @@ size_t Bu::Base64::read( void *pBuf, size_t nBytes )
83 char buf[4]; 83 char buf[4];
84 while( sIn < nBytes ) 84 while( sIn < nBytes )
85 { 85 {
86 if( rNext.read( buf, 4 ) == 0 ) 86 //if( rNext.read( buf, 4 ) == 0 )
87 return sIn; 87 // return sIn;
88 for( int j = 0; j < 4; j++ )
89 {
90 if( rNext.read( &buf[j], 1 ) == 0 )
91 return sIn;
92 if( buf[j] == ' ' || buf[j] == '\t' ||
93 buf[j] == '\n' || buf[j] == '\r' )
94 {
95 j--;
96 }
97 }
88 int iChars = 3; 98 int iChars = 3;
89 for( int j = 0; j < 4; j++ ) 99 for( int j = 0; j < 4; j++ )
90 { 100 {