Skip to content

Commit

Permalink
drivers/usb-common.c: fix C style of comments [networkupstools#2604]
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Sep 11, 2024
1 parent 6443582 commit 9f40a8f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/usb-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ static int nut_usb_get_string_descriptor(
break;
} else if (tries) {
upsdebugx(1, "%s: string descriptor %d request failed, retrying...", __func__, StringIdx);
usleep(50000); /* 50 ms, might help in some cases */
usleep(50000); /* 50 ms, might help in some cases */
}
}
return ret;
Expand Down Expand Up @@ -480,13 +480,13 @@ int nut_usb_get_string(

/* translate simple UTF-16LE to 8-bit */
len = ret < (int)buflen ? ret : (int)buflen;
len = len / 2 - 1; // 16-bit characters, without header
len = len < (int)buflen - 1 ? len : (int)buflen - 1; // reserve for null terminator
len = len / 2 - 1; /* 16-bit characters, without header */
len = len < (int)buflen - 1 ? len : (int)buflen - 1; /* reserve for null terminator */
for (i = 0; i < len; i++) {
if (buffer[2 + i * 2 + 1] == 0)
buf[i] = buffer[2 + i * 2];
else
buf[i] = '?'; // not decoded
buf[i] = '?'; /* not decoded */
}
buf[i] = '\0';

Expand Down

0 comments on commit 9f40a8f

Please sign in to comment.