When printing an USB string descriptor using pdesc/pstring,
strings have one additional character at the end.
In pstring(/sys/src/cmd/usb/lib/dump.c:297) the descriptor length in
buf[0] is interpreted as the number of bytes in the following Unicode string,
but, compared to the spec, this is two bytes (or one Rune)
too much.
Apparently buf[0] is `the number of bytes
within the string + 2' (for descriptor length and type).
The patch tries to fix it by reducing `n' by 2 before using it.
|