aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/lib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/lib.c b/lib/lib.c
index cfb71ed3..dafd514a 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -447,11 +447,11 @@ char *strend(char *str, char *suffix)
// If *a starts with b, advance *a past it and return 1, else return 0;
int strstart(char **a, char *b)
{
- int len = strlen(b), i = !strncmp(*a, b, len);
+ char *c = *a;
- if (i) *a += len;
+ if (*b) while (*b++ == *c++) if (!*b) return c-*a;
- return i;
+ return 0;
}
// If *a starts with b, advance *a past it and return 1, else return 0;