summaryrefslogtreecommitdiff
path: root/src/base32.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-01-05 16:01:46 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-01-05 16:01:46 +0000
commit4db349c1f32b4a313d12d114137432441633d00a (patch)
tree417451971e264834312cfd8339c79930d680a5d1 /src/base32.cc
parent338e8aca09331d3e7fa4e1e8e1f9d10260986772 (diff)
2010-01-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Untabify. Fixed one line in copyright which is longer than 80 columns. * src * test
Diffstat (limited to 'src/base32.cc')
-rw-r--r--src/base32.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/base32.cc b/src/base32.cc
index 3b15843c..9c30596d 100644
--- a/src/base32.cc
+++ b/src/base32.cc
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
@@ -58,8 +58,8 @@ std::string encode(const std::string& src)
if(count == 5) {
char temp[8];
for(size_t j = 0; j < 8; ++j) {
- temp[7-j] = B32TABLE[buf&0x1f];
- buf >>= 5;
+ temp[7-j] = B32TABLE[buf&0x1f];
+ buf >>= 5;
}
ret += std::string(&temp[0], &temp[8]);
count = 0;
@@ -106,15 +106,15 @@ std::string decode(const std::string& src)
char ch = src[i+j];
unsigned char value;
if('A' <= ch && ch <= 'Z') {
- value = ch-'A';
+ value = ch-'A';
} else if('2' <= ch && ch <= '7') {
- value = ch-'2'+26;
+ value = ch-'2'+26;
} else if(ch == '=') {
- done = true;
- break;
+ done = true;
+ break;
} else {
- ret.clear();
- return ret;
+ ret.clear();
+ return ret;
}
buf <<= 5;
buf += value;