mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-07 10:12:53 +03:00
coap_time.h: cast COAP_TICKS_PER_SECOND to coap_tick_t for type safety
CID 1458396 detected by Coverity scan points out that integer arithmetics may lead to an overflow without the typecast to coap_tick_t.
This commit is contained in:
1 parent
4b52182b8d
commit
a569e16584
1 file changed
+1
-1
@@ -97,7 +97,7 @@ typedef time_t coap_time_t;
|
||||
typedef int64_t coap_tick_diff_t;
|
||||
|
||||
/** Use ms resolution on POSIX systems */
|
||||
#define COAP_TICKS_PER_SECOND 1000
|
||||
#define COAP_TICKS_PER_SECOND ((coap_tick_t)(1000U))
|
||||
|
||||
/**
|
||||
* Initializes the internal clock.
|
||||
|
||||
Reference in new issue
Block a user