X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FLibraries%2Flibc.so_src%2Fstrtoi.c;h=758906fd3bf906b901d32b0c4713e961b189c150;hb=5228a990933853fc5f5df7083ff458cdaddac371;hp=9326fb8a1028bd7f60f92514b82e24cd40925e30;hpb=04a050f42807686dc119838c82372409246d55bb;p=tpg%2Facess2.git diff --git a/Usermode/Libraries/libc.so_src/strtoi.c b/Usermode/Libraries/libc.so_src/strtoi.c index 9326fb8a..758906fd 100644 --- a/Usermode/Libraries/libc.so_src/strtoi.c +++ b/Usermode/Libraries/libc.so_src/strtoi.c @@ -132,3 +132,19 @@ int atoi(const char *str) } return tmp; } + +long atol(const char *str) +{ + long long tmp = strtoll(str, NULL, 0); + if( tmp > LONG_MAX || tmp < LONG_MIN ) { + errno = ERANGE; + return (tmp > LONG_MAX) ? LONG_MAX : LONG_MIN; + } + return tmp; +} + +long long atoll(const char *str) +{ + long long tmp = strtoll(str, NULL, 0); + return tmp; +}