Skip to content

Commit

Permalink
Add some casts to quiet -Wconversion
Browse files Browse the repository at this point in the history
  • Loading branch information
millert committed Nov 17, 2024
1 parent 9613ef9 commit 3d85f2e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/util/setgroups.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ sudo_setgroups_v1(int ngids, const GETGROUPS_T *gids)
if (maxgids == -1)
maxgids = NGROUPS_MAX;
if (ngids > maxgids)
ret = setgroups(maxgids, (GETGROUPS_T *)gids);
ret = setgroups((int)maxgids, (GETGROUPS_T *)gids);
}
debug_return_int(ret);
}
2 changes: 1 addition & 1 deletion plugins/sudoers/sudo_printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ sudo_printf_int(int msg_type, const char * restrict fmt, ...)
va_end(ap);
}
if (len != -1) {
if (fwrite(buf, 1, len, ttyfp ? ttyfp : fp) == 0)
if (fwrite(buf, 1, (size_t)len, ttyfp ? ttyfp : fp) == 0)
len = -1;
if (buf != sbuf)
free(buf);
Expand Down
2 changes: 1 addition & 1 deletion src/conversation.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ sudo_conversation_printf(int msg_type, const char * restrict fmt, ...)
va_end(ap);
}
if (len != -1) {
if (fwrite(buf, 1, len, ttyfp ? ttyfp : fp) == 0)
if (fwrite(buf, 1, (size_t)len, ttyfp ? ttyfp : fp) == 0)
len = -1;
if (buf != sbuf)
free(buf);
Expand Down

0 comments on commit 3d85f2e

Please sign in to comment.