aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-02-20 17:46:15 +0200
committerRiccardo Spagni <ric@spagni.net>2018-02-20 17:46:15 +0200
commite3ad0c9ca631c88ad2752c978ad68220ea5c6d73 (patch)
treeda619300be86157d0fbd92606cdb714dd67addc2
parentMerge pull request #3235 (diff)
parentepee get_ns_count: cast to uint64_t before multiplying 10^9 to avoid overflow (diff)
downloadmonero-e3ad0c9ca631c88ad2752c978ad68220ea5c6d73.tar.xz
Merge pull request #3243
2bc8c3db epee get_ns_count: cast to uint64_t before multiplying 10^9 to avoid overflow (stoffu)
-rw-r--r--contrib/epee/include/misc_os_dependent.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/epee/include/misc_os_dependent.h b/contrib/epee/include/misc_os_dependent.h
index 99690b301..ffe575501 100644
--- a/contrib/epee/include/misc_os_dependent.h
+++ b/contrib/epee/include/misc_os_dependent.h
@@ -75,13 +75,13 @@ namespace misc_utils
clock_get_time(cclock, &mts);
mach_port_deallocate(mach_task_self(), cclock);
- return (mts.tv_sec * 1000000000) + (mts.tv_nsec);
+ return ((uint64_t)mts.tv_sec * 1000000000) + (mts.tv_nsec);
#else
struct timespec ts;
if(clock_gettime(CLOCK_MONOTONIC, &ts) != 0) {
return 0;
}
- return (ts.tv_sec * 1000000000) + (ts.tv_nsec);
+ return ((uint64_t)ts.tv_sec * 1000000000) + (ts.tv_nsec);
#endif
}