From 2800426e7ccf93fc44043bea3fd4b9411a7b0def Mon Sep 17 00:00:00 2001 From: Laurin Date: Fri, 2 Feb 2024 16:08:41 +0100 Subject: [PATCH] implemented hexStrLen function into to convert function to dynamically determine hex string length --- src/conversionOfNumbers/conversionOfNumbers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conversionOfNumbers/conversionOfNumbers.c b/src/conversionOfNumbers/conversionOfNumbers.c index 0d828bc..456801d 100644 --- a/src/conversionOfNumbers/conversionOfNumbers.c +++ b/src/conversionOfNumbers/conversionOfNumbers.c @@ -64,7 +64,7 @@ int hexStrLen(int input){ } char* convertIntToHex(int input){ - int length = 1; + int length = hexStrLen(input); int rest; char* result = (char*)malloc(sizeof(char) * length + 1); result[length] = '\0';