i3 / i3status

Generates status bar to use with i3bar, dzen2 or xmobar
BSD 3-Clause "New" or "Revised" License
602 stars 254 forks source link

i3status shows negative WiFi bitrate (integer overflow) #502

Closed n-st closed 2 years ago

n-st commented 2 years ago

With new WiFi 6 chipsets, it's possible to achieve bitrates over 2 Gbit/s. i3status stores the bitrate in bit/s as a 32-bit signed integer (print_wireless_info.c#L96), so anything above 2147483648 bit/s will overflow and become a negative value: fast_wifi

n-st commented 2 years ago

I don't have a build setup ready to test it, but it looks like it should suffice to change these lines, replacing int with long int (going to an unsigned int would only kick the can down the road until we get 4 Gbit/s WiFi):

n-st commented 2 years ago

I did end up installing the necessary build tools and testing the fix. Got a PR ready: