Fix more base64 warnings

This commit is contained in:
pancake 2015-02-09 23:37:49 +01:00
parent b93d08ebb7
commit 4ad5a7a27b
2 changed files with 5 additions and 4 deletions

View File

@ -297,7 +297,7 @@ int main(int argc, char **argv) {
case 1: // encode
{
int binlen = strlen (hashstr);
ut8 *out = malloc (((binlen+1)*4)/3);
char *out = malloc (((binlen+1)*4)/3);
if (out) {
r_base64_encode (out, (const ut8*)hashstr, binlen);
printf ("%s\n", out);
@ -310,7 +310,7 @@ int main(int argc, char **argv) {
{
ut8 *out = malloc (INSIZE);
if (out) {
int outlen = r_base64_decode (out, hashstr, strlen (hashstr));
int outlen = r_base64_decode (out, (const char *)hashstr, strlen (hashstr));
write (1, out, outlen);
free (out);
}
@ -368,7 +368,8 @@ int main(int argc, char **argv) {
case 1: // encode
{
int binlen;
ut8 *out, *bin = (ut8*)r_file_slurp (argv[i], &binlen);
char *out;
ut8 *bin = (ut8*)r_file_slurp (argv[i], &binlen);
if (!bin) {
eprintf ("Cannot open file\n");
continue;

View File

@ -266,7 +266,7 @@ static int rax (char *str, int len, int last) {
return R_TRUE;
} else if (flags & 4096) { // -E
const int len = strlen (str);
ut8* out = calloc (sizeof(ut8), ((len+1)*4)/3);
char * out = calloc (sizeof(ut8), ((len+1)*4)/3);
if (out) {
r_base64_encode (out, (const ut8*)str, len);
printf ("%s\n", out);