Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sam Schmalzried
Cryptopals
Commits
31c85e36
Commit
31c85e36
authored
Oct 03, 2018
by
Sam Schmalzried
Browse files
Added manual memory frees
parent
80ed56a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Set1/challenge1.c
View file @
31c85e36
...
...
@@ -42,6 +42,8 @@ int main(int argc, char* argv[]) {
binaryTo64
(
binaryString
,
base64String
);
printf
(
"%s
\n
"
,
base64String
);
free
(
binaryString
);
free
(
base64String
);
return
0
;
...
...
@@ -81,8 +83,9 @@ void binaryTo64(char* binaryString, char* base64String) {
strncpy
(
binaryPiece
,
binaryString
+
i
,
6
*
sizeof
(
char
));
binaryNum
=
strtol
(
binaryPiece
,
NULL
,
2
);
strncat
(
base64String
,
cb64
+
binaryNum
,
1
);
printf
(
"%s
\n
"
,
base64String
);
}
free
(
binaryPiece
);
}
void
padZeroes
(
char
*
binaryString
,
int
numZeroes
)
{
...
...
@@ -94,5 +97,7 @@ void padZeroes(char* binaryString, int numZeroes) {
}
strcat
(
tempString
,
binaryString
);
strcpy
(
binaryString
,
tempString
);
free
(
tempString
);
return
;
}
\ No newline at end of file
Set1/core
View file @
31c85e36
No preview for this file type
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment