base64: Reformat

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Sahana Prasad <sahana@redhat.com>
Reviewed-by: Eshan Kelkar <eshankelkar@galorithm.com>
This commit is contained in:
Jakub Jelen
2024-07-15 14:19:54 +02:00
committed by Sahana Prasad
parent 8ed9f5e69b
commit 9ddde3803e

View File

@@ -57,11 +57,12 @@ static int get_equals(char *string);
* @returns A buffer containing the decoded string, NULL if something went
* wrong (e.g. incorrect char).
*/
ssh_buffer base64_to_bin(const char *source) {
ssh_buffer base64_to_bin(const char *source)
{
ssh_buffer buffer = NULL;
unsigned char block[3];
char *base64;
char *ptr;
char *base64 = NULL;
char *ptr = NULL;
size_t len;
int equals;
@@ -179,7 +180,8 @@ error:
} while(0)
/* Returns 0 if ok, -1 if not (ie invalid char into the stuff) */
static int to_block4(unsigned long *block, const char *source, int num) {
static int to_block4(unsigned long *block, const char *source, int num)
{
const char *ptr = NULL;
unsigned int i;
@@ -207,7 +209,8 @@ static int to_block4(unsigned long *block, const char *source, int num) {
}
/* num = numbers of final bytes to be decoded */
static int _base64_to_bin(unsigned char dest[3], const char *source, int num) {
static int _base64_to_bin(unsigned char dest[3], const char *source, int num)
{
unsigned long block;
if (to_block4(&block, source, num) < 0) {
@@ -221,7 +224,8 @@ static int _base64_to_bin(unsigned char dest[3], const char *source, int num) {
}
/* Count the number of "=" signs and replace them by zeroes */
static int get_equals(char *string) {
static int get_equals(char *string)
{
char *ptr = string;
int num = 0;