clbr / radeontop

GNU General Public License v3.0
804 stars 70 forks source link

-b bus parameter requires decimal values #66

Closed grische closed 6 years ago

grische commented 6 years ago

According to https://github.com/clbr/radeontop/blob/master/radeontop.asc#options the option of -b should be used from the output of lspci. Unfortunately the input of -b needs to be decimal, while the output of lspci is hexadecimal: https://github.com/clbr/radeontop/blob/099045e52b2d417efc49215b2737b16bf2be74dc/radeontop.c#L124

The atoi() could be replaced by a strtoul(), but this will break existing scripts of course.

Should the logic of -b be changed to support hexadecimal arguments or should another parameter be added (e.g. -B) which allows hexadecimal inputs?

clbr commented 6 years ago

It should be changed to read hex. Most machines have the bus < 10 (0xa).