Skip to content

Commit

Permalink
Quiet a -Wconversion warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
millert committed Jan 17, 2025
1 parent a27b989 commit a5bca1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util/ttyname_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ sudo_ttyname_dev_v1(dev_t rdev, char *buf, size_t buflen)
continue;

fdpath[sizeof("/proc/self/fd/N") - 2] = '0' + fd;
len = readlink(fdpath, buf, buflen);
len = (size_t)readlink(fdpath, buf, buflen);
if (len != (size_t)-1) {
if (len == buflen) {
errno = ERANGE; /* buf too small */
Expand Down

0 comments on commit a5bca1b

Please sign in to comment.