parse-util: make safe_atou8() just a wrapper around safe_atou8_full()

As in the previous commit: it's just a wrapper around the same
strtoul(), hence let's just share some more code.
This commit is contained in:
Lennart Poettering
2022-09-05 18:17:18 +02:00
parent c74101200c
commit 11a1ac5978
2 changed files with 13 additions and 21 deletions
+5 -1
View File
@@ -36,7 +36,11 @@ static inline int safe_atou(const char *s, unsigned *ret_u) {
int safe_atoi(const char *s, int *ret_i);
int safe_atolli(const char *s, long long int *ret_i);
int safe_atou8(const char *s, uint8_t *ret);
int safe_atou8_full(const char *s, unsigned base, uint8_t *ret);
static inline int safe_atou8(const char *s, uint8_t *ret) {
return safe_atou8_full(s, 0, ret);
}
int safe_atou16_full(const char *s, unsigned base, uint16_t *ret);