From 9ff8221ffddb06638cde954c0adb4ba5ccd4ca94 Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Fri, 15 Oct 2010 10:44:32 +0200 Subject: [PATCH] fixed broken bit mask --- examples/tiny.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/tiny.c b/examples/tiny.c index b1d7048b..c728bfb8 100644 --- a/examples/tiny.c +++ b/examples/tiny.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -74,7 +75,7 @@ main(int argc, char **argv) { ctx = coap_new_context(0); if ( !ctx ) return -1; - id = rand() & ((1 << (8 * sizeof(coap_tid_t))) - 1); + id = rand() & INT_MAX; memset(&dst, 0, sizeof(struct sockaddr_in6 )); dst.sin6_family = AF_INET6;