aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/lib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/lib.c b/lib/lib.c
index dafd514a..fe402af8 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -449,9 +449,10 @@ int strstart(char **a, char *b)
{
char *c = *a;
- if (*b) while (*b++ == *c++) if (!*b) return c-*a;
+ while (*b && *c == *b) b++, c++;
+ if (!*b) *a = c;
- return 0;
+ return !*b;
}
// If *a starts with b, advance *a past it and return 1, else return 0;