diff options
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/common.c | 6 | ||||
-rw-r--r-- | src/utils/common.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/utils/common.c b/src/utils/common.c index 9856463..68413b2 100644 --- a/src/utils/common.c +++ b/src/utils/common.c @@ -1194,3 +1194,9 @@ int ssid_parse(const char *buf, struct wpa_ssid_value *ssid) return ssid->ssid_len ? 0 : -1; } + + +int str_starts(const char *str, const char *start) +{ + return os_strncmp(str, start, os_strlen(start)) == 0; +} diff --git a/src/utils/common.h b/src/utils/common.h index 197e4d1..7785677 100644 --- a/src/utils/common.h +++ b/src/utils/common.h @@ -550,6 +550,8 @@ size_t utf8_unescape(const char *inp, size_t in_size, char *outp, size_t out_size); int is_ctrl_char(char c); +int str_starts(const char *str, const char *start); + /* * gcc 4.4 ends up generating strict-aliasing warnings about some very common |