> Yes, but usbdevs(8) everywhere counts devices from zero, so probably this
should be updated,
> if it is ok I will take a look there and fix this if need in a separate
patch.
As you wish. At the very least the man page could be updated to indicate
that -a specifies a device *index*, not a *USB bu
> 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 given
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
Date:Sun, 24 Nov 2019 13:49:56 +0600
From:Alexander Kuleshov
Message-ID:
| +addr = strtol(optarg, &ep, 10);
| Any comments?
strtol() returns a long, addr is just int - something needs to be
adjusted to avoid value truncation, depending upon what's
On 24.11.2019 08:56, Alexander Kuleshov wrote:
> I sorry for noise, but wrong artifact hit to the first one patch,
> here is the update:
>
strtoi(3) is easier here than strtol(3).
>
> diff --git a/usr.sbin/usbdevs/usbdevs.c b/usr.sbin/usbdevs/usbdevs.c
> index e8fe1e7e6f4..526c1eade38 100644
>