diff --git a/lib/atoi/strtou_noneg.c b/lib/atoi/strtou_noneg.c index ec8773d7..96a0b530 100644 --- a/lib/atoi/strtou_noneg.c +++ b/lib/atoi/strtou_noneg.c @@ -14,5 +14,3 @@ extern inline uintmax_t strtou_noneg(const char *s, char **restrict endp, extern inline unsigned long strtoul_noneg(const char *s, char **restrict endp, int base); -extern inline unsigned long long strtoull_noneg(const char *s, - char **restrict endp, int base); diff --git a/lib/atoi/strtou_noneg.h b/lib/atoi/strtou_noneg.h index a1d15569..c9411d0e 100644 --- a/lib/atoi/strtou_noneg.h +++ b/lib/atoi/strtou_noneg.h @@ -23,9 +23,6 @@ inline uintmax_t strtou_noneg(const char *s, char **restrict endp, ATTR_STRING(1) ATTR_ACCESS(write_only, 2) inline unsigned long strtoul_noneg(const char *s, char **restrict endp, int base); -ATTR_STRING(1) ATTR_ACCESS(write_only, 2) -inline unsigned long long strtoull_noneg(const char *s, - char **restrict endp, int base); inline uintmax_t @@ -54,15 +51,4 @@ strtoul_noneg(const char *s, char **restrict endp, int base) } -inline unsigned long long -strtoull_noneg(const char *s, char **restrict endp, int base) -{ - if (strtol(s, endp, base) < 0) { - errno = ERANGE; - return 0; - } - return strtoull(s, endp, base); -} - - #endif // include guard diff --git a/tests/unit/test_atoi_strtou_noneg.c b/tests/unit/test_atoi_strtou_noneg.c index 978bc0c4..60631210 100644 --- a/tests/unit/test_atoi_strtou_noneg.c +++ b/tests/unit/test_atoi_strtou_noneg.c @@ -17,7 +17,6 @@ static void test_strtoul_noneg(void **state); -static void test_strtoull_noneg(void **state); int @@ -25,7 +24,6 @@ main(void) { const struct CMUnitTest tests[] = { cmocka_unit_test(test_strtoul_noneg), - cmocka_unit_test(test_strtoull_noneg), }; return cmocka_run_group_tests(tests, NULL, NULL); @@ -52,25 +50,3 @@ test_strtoul_noneg(void **state) assert_true(strtoul_noneg("-0x10000000000000000", NULL, 0) == 0); assert_true(errno == ERANGE); } - - -static void -test_strtoull_noneg(void **state) -{ - errno = 0; - assert_true(strtoull_noneg("42", NULL, 0) == 42); - assert_true(errno == 0); - - assert_true(strtoull_noneg("-1", NULL, 0) == 0); - assert_true(errno == ERANGE); - errno = 0; - assert_true(strtoull_noneg("-3", NULL, 0) == 0); - assert_true(errno == ERANGE); - errno = 0; - assert_true(strtoull_noneg("-0xFFFFFFFFFFFFFFFF", NULL, 0) == 0); - assert_true(errno == ERANGE); - - errno = 0; - assert_true(strtoull_noneg("-0x10000000000000000", NULL, 0) == 0); - assert_true(errno == ERANGE); -}