From b4f090d5642a53547ad43aa0b9c7d6f04b2d88e4 Mon Sep 17 00:00:00 2001 From: Valient Gough Date: Tue, 14 Jun 2011 05:42:54 +0000 Subject: [PATCH] merge patch from issue 102 git-svn-id: http://encfs.googlecode.com/svn/trunk@69 db9cf616-1c43-0410-9cb8-a902689de0d6 --- encfs/base64.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/encfs/base64.cpp b/encfs/base64.cpp index f86bc24..c0be230 100644 --- a/encfs/base64.cpp +++ b/encfs/base64.cpp @@ -80,7 +80,7 @@ void changeBase2Inline(unsigned char *src, int srcLen, } // we have at least one value that can be output - char outVal = work & mask; + unsigned char outVal = work & mask; work >>= dst2Pow; workBits -= dst2Pow; @@ -96,8 +96,15 @@ void changeBase2Inline(unsigned char *src, int srcLen, *outLoc++ = outVal; // we could have a partial value left in the work buffer.. - if(workBits && outputPartialLastByte) - *outLoc = work & mask; + if(outputPartialLastByte) + { + while(workBits > 0) + { + *outLoc++ = work & mask; + work >>= dst2Pow; + workBits -= dst2Pow; + } + } } }