When doing the time offset adjustments, make sure the microseconds
authorTheodore Tso <tytso@mit.edu>
Fri, 12 Apr 1996 02:18:11 +0000 (02:18 +0000)
committerTheodore Tso <tytso@mit.edu>
Fri, 12 Apr 1996 02:18:11 +0000 (02:18 +0000)
field doesn't go negative.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7800 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/ChangeLog
src/lib/krb5/os/ustime.c

index c754ca46ac3c344b6ee98b40fd4bd90302653252..c6edc6d64b1efb06934538c0b3976eecbcdae8ac 100644 (file)
@@ -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
index 9fd9dd72690bafc1f06b125d52f7f02616ad8e90..ee7535324fcbee40ab5658bd984c2615631a050d 100644 (file)
@@ -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;