[email protected]'s fix that now uses checkprefix() instead of
strnequal() when the third argument was strlen(first argument) anyway.
This makes it less prone to errors. (Slightly edited by me)
diff --git a/lib/cookie.c b/lib/cookie.c
index 64d2650..23222f2 100644
--- a/lib/cookie.c
+++ b/lib/cookie.c
@@ -519,7 +519,7 @@
char *lineptr;
bool headerline;
while(fgets(line, MAX_COOKIE_LINE, fp)) {
- if(strnequal("Set-Cookie:", line, 11)) {
+ if(checkprefix("Set-Cookie:", line)) {
/* This is a cookie line, get it! */
lineptr=&line[11];
headerline=TRUE;
@@ -587,8 +587,8 @@
/* now check the left part of the path with the cookies path
requirement */
- if(!co->path ||
- strnequal(path, co->path, strlen(co->path))) {
+ if(!co->path ||
+ checkprefix(co->path, path) ) {
/* and now, we know this is a match and we should create an
entry for the return-linked-list */