From f5345fbd381d6c30ded28d78c70e96fa572ec349 Mon Sep 17 00:00:00 2001
From: Kaspar Schleiser <kaspar@schleiser.de>
Date: Wed, 16 Jan 2019 15:16:54 +0100
Subject: [PATCH] cpu/native/periph/timer: fix undefined behaviour

---
 cpu/native/periph/timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpu/native/periph/timer.c b/cpu/native/periph/timer.c
index 6cf9557683..bd17926f5b 100644
--- a/cpu/native/periph/timer.c
+++ b/cpu/native/periph/timer.c
@@ -66,7 +66,7 @@ static struct itimerval itv;
 static unsigned long ts2ticks(struct timespec *tp)
 {
     /* TODO: check for overflow */
-    return((tp->tv_sec * NATIVE_TIMER_SPEED) + (tp->tv_nsec / 1000));
+    return(((unsigned long)tp->tv_sec * NATIVE_TIMER_SPEED) + (tp->tv_nsec / 1000));
 }
 
 /**
-- 
GitLab