Skip to content

Commit

Permalink
Merge pull request OpenEtherCATsociety#460 from OpenEtherCATsociety/A…
Browse files Browse the repository at this point in the history
…rthurKetels-add_timespec

Arthur ketels add timespec
  • Loading branch information
ArthurKetels authored Nov 9, 2020
2 parents d9261e8 + 2c1b9b2 commit 342ca86
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/linux/red_test/red_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void add_timespec(struct timespec *ts, int64 addtime)
sec = (addtime - nsec) / NSEC_PER_SEC;
ts->tv_sec += sec;
ts->tv_nsec += nsec;
if ( ts->tv_nsec > NSEC_PER_SEC )
if ( ts->tv_nsec >= NSEC_PER_SEC )
{
nsec = ts->tv_nsec % NSEC_PER_SEC;
ts->tv_sec += (ts->tv_nsec - nsec) / NSEC_PER_SEC;
Expand Down
2 changes: 1 addition & 1 deletion test/win32/red_test/red_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void add_timespec(struct timespec *ts, int64 addtime)
sec = (addtime - nsec) / NSEC_PER_SEC;
ts->tv_sec += sec;
ts->tv_nsec += nsec;
if ( ts->tv_nsec > NSEC_PER_SEC )
if ( ts->tv_nsec >= NSEC_PER_SEC )
{
nsec = ts->tv_nsec % NSEC_PER_SEC;
ts->tv_sec += (ts->tv_nsec - nsec) / NSEC_PER_SEC;
Expand Down

0 comments on commit 342ca86

Please sign in to comment.