diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2019-11-19 01:38:10 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2019-11-24 19:59:35 +0100 |
commit | 06356fd9c3234574bd26d2f123acd334b4275f3c (patch) | |
tree | fd4eb841235213ec85745a77b95c0b39aa53bd12 /include/osmocom | |
parent | ff65d24ec4cac038e07a16692c3ae64d6e5fbc3c (diff) |
utils: add osmo_strnchr()
When finding a char in a string, I want to be able to limit the search area by
size, not only by nul terminator.
Change-Id: I48f8ace9f51f8a06796648883afcabe3b4e8b537
Diffstat (limited to 'include/osmocom')
-rw-r--r-- | include/osmocom/core/utils.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 86d45bcc..1abbe989 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -139,6 +139,7 @@ uint64_t osmo_decode_big_endian(const uint8_t *data, size_t data_len); uint8_t *osmo_encode_big_endian(uint64_t value, size_t data_len); size_t osmo_strlcpy(char *dst, const char *src, size_t siz); +const char *osmo_strnchr(const char *str, size_t str_size, char c); bool osmo_is_hexstr(const char *str, int min_digits, int max_digits, bool require_even); |