Fixed the microsecond adjustment for Windows
authorRichard Basch <probe@mit.edu>
Tue, 18 Feb 1997 05:40:06 +0000 (05:40 +0000)
committerRichard Basch <probe@mit.edu>
Tue, 18 Feb 1997 05:40:06 +0000 (05:40 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9882 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/crypto/os/ChangeLog
src/lib/crypto/os/c_ustime.c

index b0b44f16040dd7b661b2cd41c1b14687b005401e..26dc9d41635040980a615db54e6d8c54d076bf8e 100644 (file)
@@ -1,3 +1,7 @@
+Mon Feb 17 17:24:41 1997  Richard Basch  <basch@lehman.com>
+
+       * c_ustime.c: Fixed microsecond adjustment code (win32)
+
 Thu Nov 21 00:58:04 EST 1996    Richard Basch   <basch@lehman.com>
 
         * Makefile.in: Win32 build
index 57606de10e6a0e47e1c18bc8f05a07e81cbca1b1..350c1aa5c74dbe58112f663b4d47183bdeda5a33 100644 (file)
@@ -141,10 +141,10 @@ register krb5_int32 *seconds, *microseconds;
 
     _ftime(&timeptr);                           /* Get the current time */
     sec  = timeptr.time;
-    usec = timeptr.millitm;
+    usec = timeptr.millitm * 1000;
 
-    if (sec == last_sec) {                      /* Same as last time??? */
-        usec = ++last_usec;                     /* Yep, so do microseconds */
+    if ((sec == last_sec) && (usec <= last_usec)) { /* Same as last time??? */
+        usec = ++last_usec;
         if (usec >= 1000000) {
             ++sec;
             usec = 0;