Use (1L << feature)' instead of (1 << feature)' to avoid problems
with integer overflows when we add more fields.
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
#include <glibtop_suid.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_kernel =
|
||||
(1 << GLIBTOP_PROC_KERNEL_K_FLAGS) + (1 << GLIBTOP_PROC_KERNEL_WCHAN);
|
||||
(1L << GLIBTOP_PROC_KERNEL_K_FLAGS) + (1L << GLIBTOP_PROC_KERNEL_WCHAN);
|
||||
|
||||
/* Provides detailed information about a process. */
|
||||
|
||||
@@ -37,7 +37,7 @@ glibtop_get_proc_kernel_p (glibtop *server, glibtop_proc_kernel *buf,
|
||||
{
|
||||
struct proc *pp;
|
||||
|
||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_KERNEL), 0);
|
||||
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_KERNEL), 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_proc_kernel));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user