Browse Source

Changed base64decode2 to base64decode_s and isBase642 to isBase64_s

release/0.19
JustinAJ 11 years ago
parent
commit
a27f96a326
  1. 2
      Jupiter/Base64.cpp
  2. 4
      Jupiter/Base64.h
  3. 4
      Jupiter/Base64C.c

2
Jupiter/Base64.cpp

@ -27,7 +27,7 @@ char *Jupiter::base64encode(const char *str)
unsigned int Jupiter::base64decode(const char *data, size_t dataLength, unsigned char *result) unsigned int Jupiter::base64decode(const char *data, size_t dataLength, unsigned char *result)
{ {
return Jupiter_base64decode2(data, dataLength, result); return Jupiter_base64decode_s(data, dataLength, result);
} }
unsigned int Jupiter::base64decode(const char *data, size_t dataLength, unsigned char *result, size_t resultSize) unsigned int Jupiter::base64decode(const char *data, size_t dataLength, unsigned char *result, size_t resultSize)

4
Jupiter/Base64.h

@ -147,7 +147,7 @@ JUPITER_API bool Jupiter_isBase64(const char *str);
* @param dataLength Length of the data to check. * @param dataLength Length of the data to check.
* @return True if the input buffer is a valid base64 string, false otherwise. * @return True if the input buffer is a valid base64 string, false otherwise.
*/ */
JUPITER_API bool Jupiter_isBase642(const char *data, size_t dataLength); JUPITER_API bool Jupiter_isBase64_s(const char *data, size_t dataLength);
/** /**
* @brief Decodes an input base64 C-String into a data buffer. * @brief Decodes an input base64 C-String into a data buffer.
@ -166,7 +166,7 @@ JUPITER_API unsigned int Jupiter_base64decode(const char *str, unsigned char *re
* @param result Data buffer for output. * @param result Data buffer for output.
* @return Number of bytes written to the output buffer. * @return Number of bytes written to the output buffer.
*/ */
JUPITER_API unsigned int Jupiter_base64decode2(const char *data, size_t dataLength, unsigned char *result); JUPITER_API unsigned int Jupiter_base64decode_s(const char *data, size_t dataLength, unsigned char *result);
#if defined __cplusplus #if defined __cplusplus
} }

4
Jupiter/Base64C.c

@ -121,7 +121,7 @@ bool Jupiter_isBase64(const char *in)
return true; return true;
} }
bool Jupiter_isBase642(const char *in, size_t inLen) bool Jupiter_isBase64_s(const char *in, size_t inLen)
{ {
if (inLen % 4 != 0) if (inLen % 4 != 0)
{ {
@ -192,7 +192,7 @@ endLoop:
return out - outOrig; return out - outOrig;
} }
unsigned int Jupiter_base64decode2(const char *in, size_t inLen, unsigned char *out) unsigned int Jupiter_base64decode_s(const char *in, size_t inLen, unsigned char *out)
{ {
unsigned char *outOrig = out; unsigned char *outOrig = out;
const char *end = in + inLen; const char *end = in + inLen;

Loading…
Cancel
Save