Skip to content

Commit

Permalink
Fix timespec.tv_nsec value conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
babelouest committed Feb 29, 2024
1 parent e9cbfda commit 9457809
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/u_websocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -2322,7 +2322,7 @@ int ulfius_websocket_wait_close(struct _websocket_manager * websocket_manager, u
if (timeout) {
clock_gettime(CLOCK_REALTIME, &abstime);
abstime.tv_sec += ((time_t)timeout / 1000);
abstime.tv_nsec += (((time_t)timeout%1000) * 1000000);
abstime.tv_nsec += ((((long int)timeout)%1000) * 1000000);
if (abstime.tv_nsec > 999999999) {
abstime.tv_nsec %= 1000000000;
abstime.tv_sec ++;
Expand Down

0 comments on commit 9457809

Please sign in to comment.