Commit 916dac2e authored by Sam Schmalzried's avatar Sam Schmalzried

allocated memory for binaryString

parent e53583e0
......@@ -31,10 +31,14 @@ int main(int argc, char* argv[]) {
exit(0);
}
char* binaryString, base64String;
int argSize = sizeof(argv[1]);
char* binaryString = calloc(sizeof(char), 4*argSize);
char* base64String = malloc(argSize);
hexToBinary(argv[1], binaryString);
free(binaryString);
//free(base64String);
return 0;
}
......@@ -43,7 +47,7 @@ void hexToBinary(char* hexString, char* binaryString) {
int i, len = strlen(hexString);
char c;
printf("len = %f", len);
printf("len = %d\n", len);
for (i = 0; i < len; i++) {
c = *(hexString+i);
strcat(binaryString, hexQuads(c));
......
File added
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment