mirror of
https://github.com/Tom-on64/kern.git
synced 2026-11-03 18:22:22 +00:00
14 lines
225 B
C
14 lines
225 B
C
#include <string.h>
|
|
|
|
unsigned int atoi(const char* str) {
|
|
unsigned int res = 0;
|
|
|
|
// TODO: Add error checking
|
|
|
|
while (*str >= '0' && *str <= '9') {
|
|
res = res * 10 + (*str++ - '0');
|
|
}
|
|
|
|
return res;
|
|
}
|