Skip to content

Commit

Permalink
Fix SCTIME_FROM_TIMESPEC garbage microseconds part
Browse files Browse the repository at this point in the history
When converting nanosecond to microseconds divide by 1000 instead
of multiplying by 1000.

Fixes Redmine bug #6585
  • Loading branch information
sfd committed Nov 28, 2023
1 parent 5a3d9dd commit 3547eda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util-time.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ typedef struct {
#define SCTIME_FROM_TIMESPEC(ts) \
(SCTime_t) \
{ \
.secs = (ts)->tv_sec, .usecs = (ts)->tv_nsec * 1000 \
.secs = (ts)->tv_sec, .usecs = (ts)->tv_nsec / 1000 \
}

#define SCTIME_TO_TIMEVAL(tv, t) \
Expand Down

0 comments on commit 3547eda

Please sign in to comment.