From 51b40e67d04baa9311e3f5d4d3f5fdbd48f0ad65 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 | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/StringManipulation.c b/src/StringManipulation.c index 6f671da..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