2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 01:49:11 +00:00

Add some casts to quiet -Wconversion

This commit is contained in:
Todd C. Miller 2024-11-17 13:01:10 -07:00
parent 9613ef9445
commit 3d85f2e98f
3 changed files with 3 additions and 3 deletions

View File

@ -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);
}

View File

@ -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);

View File

@ -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);