Skip to content

Commit

Permalink
lib/osdep: Silence PVS-Studio
Browse files Browse the repository at this point in the history
This line includes a check that exists above (off < 0); however, I
want the check to also exist here. It keeps the invariant
known at the point of use.

Signed-off-by: Joseph Benden <joe@benden.us>
  • Loading branch information
jbenden committed Jul 30, 2021
1 parent e601e5b commit 2901684
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/osdep/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ static int file_read(struct wif * wi,
ts->tv_nsec = pkh.tv_usec * 1000UL;
}

if (off < 0 || off >= len) return -1;
if (off < 0 || off >= len) return -1; //-V560
memcpy(h80211, &buf[off], rc);

return rc;
Expand Down

0 comments on commit 2901684

Please sign in to comment.