Skip to content

Commit

Permalink
Fix for issue #83
Browse files Browse the repository at this point in the history
  • Loading branch information
abratchik committed Feb 19, 2021
1 parent 897e842 commit d9b18f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libraries/HID/src/HID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ int HID_::getDescriptor(USBSetup& setup)
uint8_t HID_::getShortName(char *name)
{
if(serial) {
for(byte i=0; i<strlen_P(serial); i++) {
byte seriallen=min(strlen_P(serial), ISERIAL_MAX_LEN);
for(byte i=0; i< seriallen; i++) {
name[i] = pgm_read_byte_near(serial + i);
}
return strlen_P(serial);
return seriallen;
}
else {

Expand Down

0 comments on commit d9b18f4

Please sign in to comment.