moved here from the newlib branch
diff --git a/lib/cookie.c b/lib/cookie.c
index 00497bc..8038daf 100644
--- a/lib/cookie.c
+++ b/lib/cookie.c
@@ -62,6 +62,7 @@
 #include "cookie.h"
 #include "setup.h"
 #include "getdate.h"
+#include "strequal.h"
 
 /****************************************************************************
  *
@@ -131,7 +132,7 @@
           }
           else if(strequal("expires", name)) {
             co->expirestr=strdup(what);
-            co->expires = get_date(what, &now);
+            co->expires = curl_getdate(what, &now);
           }
           else if(!co->name) {
             co->name = strdup(name);
@@ -173,9 +174,11 @@
       return NULL;
     }
     /* strip off the possible end-of-line characters */
-    if(ptr=strchr(lineptr, '\r'))
+    ptr=strchr(lineptr, '\r');
+    if(ptr)
       *ptr=0; /* clear it */
-    if(ptr=strchr(lineptr, '\n'))
+    ptr=strchr(lineptr, '\n');
+    if(ptr)
       *ptr=0; /* clear it */
 
     firstptr=strtok(lineptr, "\t"); /* first tokenize it on the TAB */