Re: [patch] usbdevs(8) use strtol(3) instead of atoi(3) for more predictable result

2019-11-25 Thread Alexander Kuleshov
On 11-25-19, Christos Zoulas wrote: > You don't need "ep", you can pass NULL. > The updated diff: Index: usbdevs.c === RCS file: /cvsroot/src/usr.sbin/usbdevs/usbdevs.c,v retrieving revision 1.39 diff -u -p -r1.39 usbdevs.c --- usbd

Re: [patch] usbdevs(8) use strtol(3) instead of atoi(3) for more predictable result

2019-11-24 Thread 'Alexander Kuleshov'
Hello, On 11-24-19, Terry Moore wrote: > > Zero is never a legal address for an operating USB device. (It can appear > transiently during enumeration, but there's no way to operate a device in > that state; so it make no sense for address zero to be used in usermode). A > device at address zer

Re: [patch] usbdevs(8) use strtol(3) instead of atoi(3) for more predictable result

2019-11-23 Thread Alexander Kuleshov
I sorry for noise, but wrong artifact hit to the first one patch, here is the update: diff --git a/usr.sbin/usbdevs/usbdevs.c b/usr.sbin/usbdevs/usbdevs.c index e8fe1e7e6f4..526c1eade38 100644 --- a/usr.sbin/usbdevs/usbdevs.c +++ b/usr.sbin/usbdevs/usbdevs.c @@ -372,11 +372,14 @@ main(int argc, c

[patch] usbdevs(8) use strtol(3) instead of atoi(3) for more predictable result

2019-11-23 Thread Alexander Kuleshov
Hello everyone, usbdevs(8) uses atoi(3) to convert a device address given from a command line argument. But atoi(3) will return - zero in a case of non-integer value and such device will be used. This is kind of unpredictable behaviour to use a device by 0 addr in a case when wrong address was giv