diff --git a/src/encrypter.c b/src/encrypter.c index 5d2b7de..5c64552 100644 --- a/src/encrypter.c +++ b/src/encrypter.c @@ -94,7 +94,7 @@ encryptText(char *text, char *keyNew) //COUNT REQUIRED SIZE FOR returningText for (int i = 0; i < (sizeof(textKeyChain) / sizeof(int)); i++) { - numberBuffer += floor(log10(abs(textKeyChain[i]))) + 1; + numberBuffer += countIntLength(textKeyChain[i]); //CHECK FOR MINUS if (textKeyChain[i] < 0) numberBuffer++; @@ -106,7 +106,7 @@ encryptText(char *text, char *keyNew) //LOAD returningText for (int i = 0; i < (sizeof(textKeyChain) / sizeof(int)); i++) { - textBuffer = malloc(floor(log10(abs(textKeyChain[i])))); + textBuffer = malloc(countIntLength(textKeyChain[i])); sprintf(textBuffer, "%d", textKeyChain[i]);