Skip to content

Commit

Permalink
Add cast to prevent sign-compare compiler warning
Browse files Browse the repository at this point in the history
  • Loading branch information
nikias committed Mar 1, 2023
1 parent 2cebd28 commit 4e14ae1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libusbmuxd.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,11 +701,11 @@ static void get_prog_name()
size_t r = fread(tmpbuf, 1, 512, f);
if (r > 0) {
char *p = tmpbuf;
while ((p-tmpbuf < r) && (*p != '(') && (*p != '\0')) p++;
while (((size_t)(p-tmpbuf) < r) && (*p != '(') && (*p != '\0')) p++;
if (*p == '(') {
p++;
char *pname = p;
while ((p-tmpbuf < r) && (*p != ')') && (*p != '\0')) p++;
while (((size_t)(p-tmpbuf) < r) && (*p != ')') && (*p != '\0')) p++;
if (*p == ')') {
*p = '\0';
prog_name = strdup(pname);
Expand Down

0 comments on commit 4e14ae1

Please sign in to comment.