Message ID | CAKjGFBVrUevZtS4bDihRz3s3U3E0a8_DhdxEuata0vS3hLEvTQ@mail.gmail.com |
---|---|
State | New |
Headers | show |
Series | BUG: iPNPstring in f_printer USB gadget is reduced by two bytes | expand |
--- f_printer.c.orig 2021-11-26 19:12:21.632221126 +0200 +++ f_printer.c 2021-11-26 19:09:19.454991670 +0200 @@ -1003,11 +1003,11 @@ value = 0; break; } - value = strlen(dev->pnp_string) ; + value = strlen(dev->pnp_string) + 2; buf[0] = (value >> 8) & 0xFF; buf[1] = value & 0xFF; - memcpy(buf + 2, dev->pnp_string, value); - DBG(dev, "1284 PNP String: %x %s\n", value, + memcpy(buf + 2, dev->pnp_string, value - 2); + DBG(dev, "1284 PNP String: %x %s\n", value - 2, dev->pnp_string); /* Length of packet is length of length field and length of iPNPstring. */ break;