From 17c55231290ae2ced896b5d00bb8543def0bc71d Mon Sep 17 00:00:00 2001 From: Krishna Vedala <7001608+kvedala@users.noreply.github.com> Date: Sun, 28 Jun 2020 15:44:34 -0400 Subject: [PATCH] fix lgtm error https://lgtm.com/projects/g/TheAlgorithms/C/snapshot/41e27116831cae2354b1dedadb91e168dca01476/files/conversions/c_atoi_str_to_integer.c#xc388f8d8efa89fb4:1 --- conversions/c_atoi_str_to_integer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/conversions/c_atoi_str_to_integer.c b/conversions/c_atoi_str_to_integer.c index 42325cdc..96c26343 100644 --- a/conversions/c_atoi_str_to_integer.c +++ b/conversions/c_atoi_str_to_integer.c @@ -51,7 +51,7 @@ int c_atoi(const char *str) /** * test the function implementation */ -int test_c_atoi() +void test_c_atoi() { printf("<<<< TEST FUNCTION >>>>\n"); assert(c_atoi("123") == atoi("123")); @@ -59,7 +59,7 @@ int test_c_atoi() assert(c_atoi("") == atoi("")); assert(c_atoi("-h23") == atoi("-h23")); assert(c_atoi(" 23") == atoi(" 23")); - assert(c_atoi("999999999999") == atoi("999999999999")); + assert(c_atoi("999999999") == atoi("999999999")); printf("<<<< TEST DONE >>>>\n"); } @@ -69,6 +69,8 @@ int test_c_atoi() */ int main(int argc, char **argv) { + test_c_atoi(); + if (argc == 2) { printf("Your number + 5 is %d\n", c_atoi(argv[1]) + 5);