From 04b79ff3f87683b17675a39c0e1c1d5073c2b5ac Mon Sep 17 00:00:00 2001 From: Jordan Cristiano Date: Sun, 12 Jul 2015 22:50:55 -0400 Subject: [PATCH] Updated to cbase64-1.1 --- external/{cbase64-1.0 => cbase64-1.1}/AUTHORS | 0 external/{cbase64-1.0 => cbase64-1.1}/LICENSE | 0 .../{cbase64-1.0 => cbase64-1.1}/README.md | 0 .../include/cbase64/cbase64.h | 21 +++++++++---------- premake/premake5.lua | 2 +- 5 files changed, 11 insertions(+), 12 deletions(-) rename external/{cbase64-1.0 => cbase64-1.1}/AUTHORS (100%) rename external/{cbase64-1.0 => cbase64-1.1}/LICENSE (100%) rename external/{cbase64-1.0 => cbase64-1.1}/README.md (100%) rename external/{cbase64-1.0 => cbase64-1.1}/include/cbase64/cbase64.h (93%) diff --git a/external/cbase64-1.0/AUTHORS b/external/cbase64-1.1/AUTHORS similarity index 100% rename from external/cbase64-1.0/AUTHORS rename to external/cbase64-1.1/AUTHORS diff --git a/external/cbase64-1.0/LICENSE b/external/cbase64-1.1/LICENSE similarity index 100% rename from external/cbase64-1.0/LICENSE rename to external/cbase64-1.1/LICENSE diff --git a/external/cbase64-1.0/README.md b/external/cbase64-1.1/README.md similarity index 100% rename from external/cbase64-1.0/README.md rename to external/cbase64-1.1/README.md diff --git a/external/cbase64-1.0/include/cbase64/cbase64.h b/external/cbase64-1.1/include/cbase64/cbase64.h similarity index 93% rename from external/cbase64-1.0/include/cbase64/cbase64.h rename to external/cbase64-1.1/include/cbase64/cbase64.h index 31713e0..62b535a 100644 --- a/external/cbase64-1.0/include/cbase64/cbase64.h +++ b/external/cbase64-1.1/include/cbase64/cbase64.h @@ -163,8 +163,7 @@ unsigned int cbase64_decode_block(const char* code_in, unsigned int length_in, const char* const codeend = code_in + length_in; unsigned char* datachar = data_out; char fragment; - - *datachar = state_in->result; + char overwrite = state_in->result; switch (state_in->step) { @@ -175,47 +174,47 @@ unsigned int cbase64_decode_block(const char* code_in, unsigned int length_in, if (codechar == codeend) { state_in->step = step_A; - state_in->result = *datachar; + state_in->result = overwrite; return datachar - data_out; } fragment = cbase64__decode_value(*codechar++); } while (fragment < 0); - *datachar = (fragment & 0x03f) << 2; + *datachar = (fragment & 0x03f) << 2; case step_B: do { if (codechar == codeend) { state_in->step = step_B; - state_in->result = *datachar; + state_in->result = overwrite; return datachar - data_out; } fragment = cbase64__decode_value(*codechar++); } while (fragment < 0); *datachar++ |= (fragment & 0x030) >> 4; - *datachar = (fragment & 0x00f) << 4; + overwrite = (fragment & 0x00f) << 4; case step_C: do { if (codechar == codeend) { state_in->step = step_C; - state_in->result = *datachar; + state_in->result = overwrite; return datachar - data_out; } fragment = cbase64__decode_value(*codechar++); } while (fragment < 0); - *datachar++ |= (fragment & 0x03c) >> 2; - *datachar = (fragment & 0x003) << 6; + *datachar++ = overwrite | (fragment & 0x03c) >> 2; + overwrite = (fragment & 0x003) << 6; case step_D: do { if (codechar == codeend) { state_in->step = step_D; - state_in->result = *datachar; + state_in->result = overwrite; return datachar - data_out; } fragment = cbase64__decode_value(*codechar++); } while (fragment < 0); - *datachar++ |= (fragment & 0x03f); + *datachar++ = overwrite | (fragment & 0x03f); } } // control should not reach here diff --git a/premake/premake5.lua b/premake/premake5.lua index 05a726f..61b3315 100644 --- a/premake/premake5.lua +++ b/premake/premake5.lua @@ -29,7 +29,7 @@ solution "demboyz" includedirs { "../external/json_checker/include", - "../external/cbase64-1.0/include", + "../external/cbase64-1.1/include", "../external/sourcesdk/include", "../external/rapidjson-1.0.2/include", "../demboyz"