diff options
author | Bastien Nocera <hadess@hadess.net> | 2003-12-23 10:44:33 +0000 |
---|---|---|
committer | Bastien Nocera <hadess@src.gnome.org> | 2003-12-23 10:44:33 +0000 |
commit | 79fdd6cd3b65bfa22c995abfa36a0a55894ecae9 (patch) | |
tree | 56f12caa4b1dd111521bacfad733e6408532f9ea /sysdeps/linux/glibtop_server.h | |
parent | 291d63f2b963375273d762a3d1a0404241f0c08e (diff) | |
download | libgtop-79fdd6cd3b65bfa22c995abfa36a0a55894ecae9.tar.gz |
Apply patch from Benoît Dejean <bnet@ifrance.com> to fix overflow issues
2003-12-23 Bastien Nocera <hadess@hadess.net>
* cpu.c: (glibtop_get_cpu_s):
* glibtop_server.h:
* loadavg.c: (glibtop_get_loadavg_s):
* mem.c: (glibtop_get_mem_s):
* netload.c: (glibtop_get_netload_s):
* prockernel.c: (glibtop_get_proc_kernel_s):
* procmem.c: (glibtop_get_proc_mem_s):
* procsegment.c: (glibtop_get_proc_segment_s):
* procsignal.c: (glibtop_get_proc_signal_s):
* proctime.c: (glibtop_get_proc_time_s):
* procuid.c: (glibtop_get_proc_uid_s):
* swap.c: (glibtop_get_swap_s): Apply patch from Benoît Dejean
<bnet@ifrance.com> to fix overflow issues using strtol
(Closes: #129881)
Diffstat (limited to 'sysdeps/linux/glibtop_server.h')
-rw-r--r-- | sysdeps/linux/glibtop_server.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sysdeps/linux/glibtop_server.h b/sysdeps/linux/glibtop_server.h index 4ff62746..22060a3f 100644 --- a/sysdeps/linux/glibtop_server.h +++ b/sysdeps/linux/glibtop_server.h @@ -57,17 +57,17 @@ skip_line (const char *p) return (char *) ++p; } -static inline unsigned long +static inline unsigned long long get_scaled(const char *buffer, const char *key) { const char *ptr; char *next; - unsigned long value = 0; + unsigned long long value = 0; if ((ptr = strstr(buffer, key))) { ptr += strlen(key); - value = strtoul(ptr, &next, 0); + value = strtoull(ptr, &next, 0); if (strchr(next, 'k')) value *= 1024; else if (strchr(next, 'M')) |