From 1aca2ff28ece7f3bae23f38b68e523d0f25e3dca Mon Sep 17 00:00:00 2001 From: hniksic Date: Wed, 18 May 2005 10:22:28 -0700 Subject: [PATCH] [svn] Remove unnecessary casts to time_t. Insert the cast from -1 to time_t, needed on systems with unsigned time_t. --- src/ChangeLog | 8 ++++++++ src/cookies.c | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 9e3d845f..d4a30682 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2005-05-18 Hrvoje Niksic + + * cookies.c (update_cookie_field): Explicitly cast -1 to time_t to + cope with systems where time_t is unsigned. + + * cookies.c: Remove unnecessary casts to time_t from values + already of that type. + 2005-05-17 Hrvoje Niksic * ftp.c (ftp_loop_internal): Same here. diff --git a/src/cookies.c b/src/cookies.c index eb3f879f..616748c8 100644 --- a/src/cookies.c +++ b/src/cookies.c @@ -264,7 +264,7 @@ store_cookie (struct cookie_jar *jar, struct cookie *cookie) #ifdef ENABLE_DEBUG if (opt.debug) { - time_t exptime = (time_t) cookie->expiry_time; + time_t exptime = cookie->expiry_time; DEBUGP (("\nStored cookie %s %d%s %s <%s> <%s> [expiry %s] %s %s\n", cookie->domain, cookie->port, cookie->port == PORT_ANY ? " (ANY)" : "", @@ -394,10 +394,10 @@ update_cookie_field (struct cookie *cookie, BOUNDED_TO_ALLOCA (value_b, value_e, value_copy); expires = http_atotm (value_copy); - if (expires != -1) + if (expires != (time_t) -1) { cookie->permanent = 1; - cookie->expiry_time = (time_t)expires; + cookie->expiry_time = expires; } else /* Error in expiration spec. Assume default (cookie doesn't -- 2.39.2