summaryrefslogtreecommitdiffstats
path: root/crypto/o_time.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2012-11-20 16:20:40 +0100
committerDr. Stephen Henson <steve@openssl.org>2012-11-20 16:20:40 +0100
commit598c423e65e9e35b5674d1d41581d2658242d86f (patch)
tree66d07ddc036144d49c40aa7b1644f1ef7d4273e6 /crypto/o_time.c
parentfirst parameter is difference in days, not years (diff)
downloadopenssl-598c423e65e9e35b5674d1d41581d2658242d86f.tar.xz
openssl-598c423e65e9e35b5674d1d41581d2658242d86f.zip
don't use psec or pdays if NULL
Diffstat (limited to 'crypto/o_time.c')
-rw-r--r--crypto/o_time.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/o_time.c b/crypto/o_time.c
index f8cf590c27..49bff49f2b 100644
--- a/crypto/o_time.c
+++ b/crypto/o_time.c
@@ -289,8 +289,10 @@ int OPENSSL_gmtime_diff(struct tm *from, struct tm *to, int *pday, int *psec)
diff_sec -= SECS_PER_DAY;
}
- *pday = (int)diff_day;
- *psec = diff_sec;
+ if (pday)
+ *pday = (int)diff_day;
+ if (psec)
+ *psec = diff_sec;
return 1;