Correctly read the cookies file to extract valid cookies

This commit is contained in:
alexhudson
2007-10-15 09:03:00 +00:00
parent 7a318a0aaa
commit 9727ccb405
+1 -1
View File
@@ -96,7 +96,7 @@ MsgAuthFindCookie(const char *username, const char *token)
cookiefile = fopen(path, "r");
if (! cookiefile) return 2;
while (fread(&cookie, 1, sizeof(MsgAuthCookie), cookiefile) != sizeof(MsgAuthCookie)) {
while (fread(&cookie, 1, sizeof(MsgAuthCookie), cookiefile) == sizeof(MsgAuthCookie)) {
if (cookie.expiration < now) {
expired_tokens = TRUE;
continue;