libsudo_util: silence most -Wconversion warnings.

This commit is contained in:
Todd C. Miller
2023-07-07 15:07:04 -06:00
parent f7801f2160
commit 5768d374cc
29 changed files with 128 additions and 111 deletions

View File

@@ -116,7 +116,7 @@ sudo_secure_fd_v1(int fd, unsigned int type, uid_t uid, gid_t gid,
* Sets error to SUDO_PATH_SECURE on success, and a value < 0 on failure.
*/
static int
sudo_secure_open(const char *path, int type, uid_t uid, gid_t gid,
sudo_secure_open(const char *path, unsigned int type, uid_t uid, gid_t gid,
struct stat *sb, int *error)
{
struct stat stat_buf;
@@ -179,7 +179,7 @@ sudo_open_conf_path_v1(const char *path, char *name, size_t namesize,
for (cp = sudo_strsplit(path, path_end, ":", &ep);
cp != NULL; cp = sudo_strsplit(NULL, path_end, ":", &ep)) {
const size_t len = ep - cp;
const size_t len = (size_t)(ep - cp);
if (len >= namesize) {
/* We always set name, even on error. */
memcpy(name, cp, namesize - 1);