implemented why2_realloc
This commit is contained in:
parent
384678b055
commit
7baaca49c2
@ -97,7 +97,7 @@ why2_output_flags why2_decrypt_text(char *text, char *keyNew)
|
||||
numberBuffer++;
|
||||
}
|
||||
|
||||
textBuffer = realloc(textBuffer, numberBuffer + 1);
|
||||
textBuffer = why2_realloc(textBuffer, numberBuffer + 1);
|
||||
|
||||
//CLEAN (POSSIBLY EXISTING) JUNK in textBuffer
|
||||
for (int j = 0; j <= numberBuffer; j++)
|
||||
|
@ -98,7 +98,7 @@ why2_output_flags why2_encrypt_text(char *text, char *keyNew)
|
||||
{
|
||||
numberBuffer = sizeof(int) * why2_count_int_length(textKeyChain[i]);
|
||||
|
||||
textBuffer = realloc(textBuffer, numberBuffer);
|
||||
textBuffer = why2_realloc(textBuffer, numberBuffer);
|
||||
|
||||
sprintf(textBuffer, "%d", textKeyChain[i]);
|
||||
|
||||
@ -106,7 +106,7 @@ why2_output_flags why2_encrypt_text(char *text, char *keyNew)
|
||||
|
||||
if (i != (int) strlen(text) - 1)
|
||||
{
|
||||
textBuffer = realloc(textBuffer, 2);
|
||||
textBuffer = why2_realloc(textBuffer, 2);
|
||||
sprintf(textBuffer, "%c", why2_get_encryption_separator());
|
||||
|
||||
strcat(returningText, textBuffer);
|
||||
|
@ -85,7 +85,7 @@ int main(void)
|
||||
{
|
||||
statusBuffer = strdup("failed");
|
||||
|
||||
outputBuffer = realloc(outputBuffer, strlen(encrypted.outputText) + 6);
|
||||
outputBuffer = why2_realloc(outputBuffer, strlen(encrypted.outputText) + 6);
|
||||
sprintf(outputBuffer, "\t\t\"%s\"\n", encrypted.outputText);
|
||||
|
||||
outputStreamBuffer = stderr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user