Commit 17e6cadc authored by Sam Schmalzried's avatar Sam Schmalzried

switched to using strdup instead of strcpy

parent f512e724
......@@ -13,7 +13,7 @@ int main(int argc, char* argv[]) {
char* binaryString, base64String;
strcpy(binaryString, hexToBinary(argv[1]));
binaryString = hexToBinary(argv[1]);
return 0;
}
......@@ -21,11 +21,11 @@ int main(int argc, char* argv[]) {
char* hexToBinary(char* hexString) {
char* binaryString = malloc(4 * sizeof(hexString));
return binaryString;
return strdup(binaryString);
}
char* binaryTo64(char* binaryString) {
char* base64String = malloc(sizeof(binaryString));
return base64String;
}
\ No newline at end of file
return strdup(base64String);
}
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