10000 Update clock.c · g-coder/midikit@998809c · GitHub
[go: up one dir, main page]

Skip to content

Commit 998809c

Browse files
committed
Update clock.c
fix for integer overflow issue.
1 parent 7e5aa1a commit 998809c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

midi/clock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static void _init_clock_posix( struct MIDIClock * clock ) {
167167
static unsigned long long _timestamp_posix( void ) {
168168
static struct timespec ts;
169169
clock_gettime( POSIX_CLOCK_TYPE, &ts );
170-
return (ts.tv_sec * NSEC_PER_SEC + ts.tv_nsec);
170+
return ((unsigned long long)tv.tv_sec * USEC_PER_SEC + tv.tv_usec);
171171
}
172172
#endif
173173

0 commit comments

Comments
 (0)
0