diff options
author | Jakob Kaivo <jkk@ung.org> | 2019-02-27 19:17:39 -0500 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2019-02-27 19:17:39 -0500 |
commit | e1477898d0203dae4b2fe9ad62998bc27d4b4fc9 (patch) | |
tree | bda9ccc11307e41de7c5a4e6e4e92088fe4b1804 /src/inttypes/strtoimax.c | |
parent | fcb83049b1942fafa784fc51869818651c04acbb (diff) |
add common _strtoi function body
Diffstat (limited to 'src/inttypes/strtoimax.c')
-rw-r--r-- | src/inttypes/strtoimax.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/inttypes/strtoimax.c b/src/inttypes/strtoimax.c index 5a68c47c..e473c210 100644 --- a/src/inttypes/strtoimax.c +++ b/src/inttypes/strtoimax.c @@ -1,19 +1,16 @@ +#include "stddef.h" #include <inttypes.h> +#include "errno.h" intmax_t strtoimax(const char * restrict nptr, char ** restrict endptr, int base) { - /* like strotoll */ + intmax_t ret = 0; + intmax_t max = INTMAX_MAX; + intmax_t min = INTMAX_MIN; - /* if > INTMAX_MAX */ - /* errno = ERANGE; */ - /* return INTMAX_MAX */ + #include "../stdlib/_strtoi.h" - /* if < INTMAX_MIN */ - /* errno = ERANGE; */ - /* return INTMAX_MIN; */ - - /* if no conversion */ - return 0; + return ret; } /* |