summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1996-04-12 02:18:11 +0000
committerTheodore Tso <tytso@mit.edu>1996-04-12 02:18:11 +0000
commit91ea416bc25d6b143871241bb023f100ae40e1a5 (patch)
treef453a127414aa5fc2e15215baa4f261f4559ca64
parent973c33dfefb55a97375dc9269d2764373b918f24 (diff)
downloadkrb5-91ea416bc25d6b143871241bb023f100ae40e1a5.tar.gz
krb5-91ea416bc25d6b143871241bb023f100ae40e1a5.tar.xz
krb5-91ea416bc25d6b143871241bb023f100ae40e1a5.zip
When doing the time offset adjustments, make sure the microseconds
field doesn't go negative. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7800 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/lib/krb5/os/ChangeLog6
-rw-r--r--src/lib/krb5/os/ustime.c4
2 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog
index c754ca46a..c6edc6d64 100644
--- a/src/lib/krb5/os/ChangeLog
+++ b/src/lib/krb5/os/ChangeLog
@@ -1,3 +1,9 @@
+Thu Apr 11 22:15:44 1996 Theodore Y. Ts'o <tytso@dcl>
+
+ * ustime.c (krb5_us_timeofday): When doing the time offset
+ adjustments, make sure the microseconds field doesn't go
+ negative.
+
Thu Mar 28 17:20:12 1996 Theodore Y. Ts'o <tytso@dcl>
* DNR.c: Replace eight-year-old version of this file with the
diff --git a/src/lib/krb5/os/ustime.c b/src/lib/krb5/os/ustime.c
index 9fd9dd726..ee7535324 100644
--- a/src/lib/krb5/os/ustime.c
+++ b/src/lib/krb5/os/ustime.c
@@ -53,6 +53,10 @@ krb5_us_timeofday(context, seconds, microseconds)
usec -= 1000000;
sec++;
}
+ if (usec < 0) {
+ usec += 1000000;
+ sec--;
+ }
sec += os_ctx->time_offset;
}
*seconds = sec;