summaryrefslogtreecommitdiff
path: root/src/inttypes/wcstoimax.c
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-02-27 19:17:39 -0500
committerJakob Kaivo <jkk@ung.org>2019-02-27 19:17:39 -0500
commite1477898d0203dae4b2fe9ad62998bc27d4b4fc9 (patch)
treebda9ccc11307e41de7c5a4e6e4e92088fe4b1804 /src/inttypes/wcstoimax.c
parentfcb83049b1942fafa784fc51869818651c04acbb (diff)
add common _strtoi function body
Diffstat (limited to 'src/inttypes/wcstoimax.c')
-rw-r--r--src/inttypes/wcstoimax.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/inttypes/wcstoimax.c b/src/inttypes/wcstoimax.c
index 12c9a850..d086ede4 100644
--- a/src/inttypes/wcstoimax.c
+++ b/src/inttypes/wcstoimax.c
@@ -1,19 +1,16 @@
+#include "stddef.h"
#include <inttypes.h>
+#include "errno.h"
intmax_t wcstoimax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base)
{
- /* like wcstoll */
+ 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;
}
/*