diff options
Diffstat (limited to 'tools/lib/string.c')
-rw-r--r-- | tools/lib/string.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/lib/string.c b/tools/lib/string.c index bd239bc1d557..8e678af1c6ee 100644 --- a/tools/lib/string.c +++ b/tools/lib/string.c | |||
@@ -87,3 +87,12 @@ size_t __weak strlcpy(char *dest, const char *src, size_t size) | |||
87 | } | 87 | } |
88 | return ret; | 88 | return ret; |
89 | } | 89 | } |
90 | |||
91 | int prefixcmp(const char *str, const char *prefix) | ||
92 | { | ||
93 | for (; ; str++, prefix++) | ||
94 | if (!*prefix) | ||
95 | return 0; | ||
96 | else if (*str != *prefix) | ||
97 | return (unsigned char)*prefix - (unsigned char)*str; | ||
98 | } | ||