fixed bug #3526909 (Wrong unit conversion) pointed out by jsucaet

Applied patch provided by jsucaet.
This commit is contained in:
Olaf Bergmann committed 2012-05-29 19:54:36 +02:00
1 parent 28a6d45cde
commit abf33c87f9
5 files changed
+7 -7

No files matched your search

+1 -1
View File
@@ -394,7 +394,7 @@ main(int argc, char **argv) {
if ( nextpdu && nextpdu->t <= now + COAP_RESOURCE_CHECK_TIME ) {
/* set timeout if there is a pdu to send before our automatic timeout occurs */
tv.tv_usec = ((nextpdu->t - now) % COAP_TICKS_PER_SECOND) << 10;
tv.tv_usec = ((nextpdu->t - now) % COAP_TICKS_PER_SECOND) * 1000000 / COAP_TICKS_PER_SECOND;
tv.tv_sec = (nextpdu->t - now) / COAP_TICKS_PER_SECOND;
timeout = &tv;
} else {