[hackers] [slstatus] ram: fixed int overflow on pagetok macro || Tobias Tschinkowitz

From: <git_AT_suckless.org>
Date: Thu, 24 May 2018 14:51:48 +0200 (CEST)

commit 5db729fedbc4b6cb8742c58ff4934afb50732974
Author: Tobias Tschinkowitz <he4d_AT_posteo.de>
AuthorDate: Thu May 24 12:09:26 2018 +0200
Commit: Aaron Marcher <me_AT_drkhsh.at>
CommitDate: Thu May 24 14:51:30 2018 +0200

    ram: fixed int overflow on pagetok macro

diff --git a/components/ram.c b/components/ram.c
index 0ac9753..0333b3b 100644
--- a/components/ram.c
+++ b/components/ram.c
_AT_@ -75,7 +75,7 @@
         #include <unistd.h>
 
         #define LOG1024 10
- #define pagetok(size, pageshift) ((size) << (pageshift - LOG1024))
+ #define pagetok(size, pageshift) (size_t)(size << (pageshift - LOG1024))
 
         inline int
         load_uvmexp(struct uvmexp *uvmexp)
Received on Thu May 24 2018 - 14:51:48 CEST

This archive was generated by hypermail 2.3.0 : Thu May 24 2018 - 15:00:32 CEST