From f5504230b0cfe4859268fb22377e9fa758ac68eb Mon Sep 17 00:00:00 2001 From: fdai7057 Date: Fri, 20 Jan 2023 15:29:20 +0100 Subject: [PATCH] refactoring: rename variables for better understanding, write comment to explain function generateCheckString(), optimize intendation. --- src/StringManipulation.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/StringManipulation.c b/src/StringManipulation.c index d9aaf32..cd2ad2c 100644 --- a/src/StringManipulation.c +++ b/src/StringManipulation.c @@ -11,13 +11,13 @@ char *to_string(int number) } else { - int cpy = number, len = 0; - while(number>0){ + int cpy = number, len = 0; + while(number>0){ ++len; number /= 10; - } - char *str = calloc(len+1, sizeof(char)); - for(int i=0,j=len-1;i