woodruffw / screenfetch-c

A rewrite of screenFetch in C.
MIT License
73 stars 17 forks source link

overflow in memory detection #40

Closed zzxyz closed 6 years ago

zzxyz commented 6 years ago

image

igc@thor:screenfetch-c$ prtdiag | grep -i 'memory' Memory size: 130848 Megabytes ======================= Physical Memory Configuration ======================== igc@thor:screenfetch-c$ screenfetch-c MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM igc@thor MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM██MMMM$MMMMMMMMMMMM OS: SunOS MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM█MMMM██MMMM█MMMMMMMMMMMM Kernel: 5.11 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM████████████MMMMMMMMMMMM CPU: UltraSPARC-T2+ (chipid 65552, clock 1415 MHz) MMMMMMMMMMMMMMMMMMMMMMMMMM██M██████████████MM█MMMMMMMMM GPU: Unknown MMMMMMMMMMMMMMMMMMMMMMMMMMM████████████████████MMMMMMMM Shell: bash version 4.3.33(1) MMMMMMMMMMMMMMMMMMMMMMMMMMM███████████████████MMMMMNMMM Packages: 942 MMMMMMMMMMMMMMMMMMMMM██████████████████████████████MMMM Disk: 2G / 3G (66%) MMMMMMMMMMMMMMMMMMMMMMMM█████████████████████████MMMMMM Memory: -224MB ======================================================= Uptime: 69d 22h 17m 27s MMM###NMMMMM####MMMM##MMMMMM####MMMMM#####MM##MMMM###MM Resolution: 1600x1200 MM##MMMMMM###MM###MM##MMMM##MMM##MMMM###MMMM##MM###MMMM DE: Gnome M##MMMMMMM##MMMM##MM##MMMMMMMMMM##MMM##MMMMM##MM##MMMMM WM: Metacity MM####MMM###MMMM##MM##MMMMM#######MMM##MMMMM##MMM####MM WM Theme: Unknown MMMMM###MM##MMMM##MM##MMMM##MMMM##MMM##MMMMM##MMMMMN##M GTK: Not implemented MMMMMM##MM###MM###MM##MMMM##MMM###MMM##MMMMM##MMMMMM##M Icon Theme: Unknown M######MMMMM####MMMM=####MM#######MMM##MMMMM##MM#####MM Font: Unknown igc@thor:screenfetch-c$

igc@thor:screenfetch-c$

zzxyz commented 6 years ago

(overflow at a guess. Perhaps the issue is something else.)

zzxyz commented 6 years ago

This fixes: diff --git a/src/plat/sun/detect.c b/src/plat/sun/detect.c index bf6fb24..79196c4 100644 --- a/src/plat/sun/detect.c +++ b/src/plat/sun/detect.c @@ -186,7 +186,7 @@ void detect_mem(void) { long long total_mem = 0;

woodruffw commented 6 years ago

Thanks for debugging this. I'll fix it in a bit.