diff --git a/lib/util/setgroups.c b/lib/util/setgroups.c index 7298fcc04..83e0c4a9a 100644 --- a/lib/util/setgroups.c +++ b/lib/util/setgroups.c @@ -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); } diff --git a/plugins/sudoers/sudo_printf.c b/plugins/sudoers/sudo_printf.c index f5ca60231..cb6bf47b8 100644 --- a/plugins/sudoers/sudo_printf.c +++ b/plugins/sudoers/sudo_printf.c @@ -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); diff --git a/src/conversation.c b/src/conversation.c index ea2469ff3..9cc340c4d 100644 --- a/src/conversation.c +++ b/src/conversation.c @@ -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);