diff options
| author | Simon Ser <contact@emersion.fr> | 2025-01-07 13:21:37 +0100 |
|---|---|---|
| committer | Kenny Levinsen <kl@kl.wtf> | 2025-01-07 16:35:31 +0100 |
| commit | c55dff95bcf2875ff26a0505c6eda44947ed927d (patch) | |
| tree | 35f3b8af610894513e2ea0ae7321b1c631708bc9 /common | |
| parent | 801bc76ce3ab2f620e30d1d0ad979caa5b03a164 (diff) | |
stringop: move over has_prefix()
Diffstat (limited to 'common')
| -rw-r--r-- | common/stringop.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/common/stringop.c b/common/stringop.c index 16d04917..dcbd1656 100644 --- a/common/stringop.c +++ b/common/stringop.c @@ -360,3 +360,7 @@ char *format_str(const char *fmt, ...) { va_end(args); return str; } + +bool has_prefix(const char *str, const char *prefix) { + return strncmp(str, prefix, strlen(prefix)) == 0; +} |
