simplified cleaning allocated returningText with calloc

This commit is contained in:
Václav Šmejkal 2022-12-10 15:31:18 +01:00
parent 59ba4c8d08
commit 38956cce14
No known key found for this signature in database
GPG Key ID: FD749A97DF2D5E19

View File

@ -90,8 +90,7 @@ outputFlags encryptText(char *text, char *keyNew)
} }
//ALLOCATE returningText (WITH THE SEPARATORS) //ALLOCATE returningText (WITH THE SEPARATORS)
returningText = malloc(numberBuffer + strlen(text)); returningText = calloc(numberBuffer + strlen(text), sizeof(char));
strcpy(returningText, "");
//LOAD returningText //LOAD returningText
for (int i = 0; i < (int) strlen(text); i++) for (int i = 0; i < (int) strlen(text); i++)