mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 04:52:59 +01:00
base64: make input argument const
This commit is contained in:
parent
4ca6cd70cb
commit
2cc1ac4fa8
@ -56,7 +56,7 @@ static char getsymbol(unsigned char code)
|
||||
return (char)BASE64_NOT_DEFINED;
|
||||
}
|
||||
|
||||
int base64_encode(unsigned char *data_in, size_t data_in_size, \
|
||||
int base64_encode(const unsigned char *data_in, size_t data_in_size,
|
||||
unsigned char *base64_out, size_t *base64_out_size)
|
||||
{
|
||||
size_t required_size = 4 * ((data_in_size + 2) / 3);
|
||||
@ -159,7 +159,7 @@ static int getcode(char symbol)
|
||||
return BASE64_NOT_DEFINED;
|
||||
}
|
||||
|
||||
int base64_decode(unsigned char *base64_in, size_t base64_in_size, \
|
||||
int base64_decode(const unsigned char *base64_in, size_t base64_in_size,
|
||||
unsigned char *data_out, size_t *data_out_size)
|
||||
{
|
||||
size_t required_size = ((base64_in_size / 4) * 3);
|
||||
|
@ -50,7 +50,7 @@ extern "C" {
|
||||
BASE64_ERROR_DATA_IN if `data_in` equals NULL,
|
||||
BASE64_ERROR_DATA_IN_SIZE if `data_in_size` is less then 1.
|
||||
*/
|
||||
int base64_encode(unsigned char *data_in, size_t data_in_size, \
|
||||
int base64_encode(const unsigned char *data_in, size_t data_in_size,
|
||||
unsigned char *base64_out, size_t *base64_out_size);
|
||||
|
||||
/**
|
||||
@ -71,7 +71,7 @@ int base64_encode(unsigned char *data_in, size_t data_in_size, \
|
||||
BASE64_ERROR_DATA_IN if `base64_in` equals NULL,
|
||||
BASE64_ERROR_DATA_IN_SIZE if `base64_in_size` is less then 4.
|
||||
*/
|
||||
int base64_decode(unsigned char *base64_in, size_t base64_in_size, \
|
||||
int base64_decode(const unsigned char *base64_in, size_t base64_in_size,
|
||||
unsigned char *data_out, size_t *data_out_size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Loading…
Reference in New Issue
Block a user