diff options
Diffstat (limited to 'ubus_common.h')
-rw-r--r-- | ubus_common.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ubus_common.h b/ubus_common.h index 4bb9927..5e4d0ad 100644 --- a/ubus_common.h +++ b/ubus_common.h @@ -21,4 +21,13 @@ #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) #endif +static inline bool ubus_strmatch_len(const char *s1, const char *s2, int *len) +{ + for (*len = 0; s1[*len] == s2[*len]; (*len)++) + if (!s1[*len]) + return true; + + return false; +} + #endif |