clean rename itoa to ntoa for number to ascii

This commit is contained in:
starnakin 2023-06-18 19:49:21 +02:00
parent 764761a58f
commit 8c972a3096
3 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,4 @@
itoa_get_size(number) ntoa_get_size(number)
{ {
local size = 0; local size = 0;
@ -13,12 +13,12 @@ itoa_get_size(number)
} }
} }
itoa(number) ntoa(number)
{ {
local str; local str;
local size; local size;
size = itoa_get_size(number); size = ntoa_get_size(number);
str = galloc(size + 1); str = galloc(size + 1);
if (str == 0) if (str == 0)
return (0); return (0);

View File

@ -1,7 +1,7 @@
putnum(number) putnum(number)
{ {
local str; local str;
str = itoa(number); str = ntoa(number);
if (str == 0) if (str == 0)
return; return;
putstr(str); putstr(str);

View File

@ -2,15 +2,15 @@ main()
{ {
local ptr; local ptr;
name = "itoa"; name = "ntoa";
ptr = itoa(9000); ptr = ntoa(9000);
test_str(ptr, "9000", ""); test_str(ptr, "9000", "");
free(ptr); free(ptr);
ptr = itoa(55); ptr = ntoa(55);
test_str(ptr, "55", ""); test_str(ptr, "55", "");
free(ptr); free(ptr);
ptr = itoa(0); ptr = ntoa(0);
test_str(ptr, "0", ""); test_str(ptr, "0", "");
free(ptr); free(ptr);
} }