2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-09-05 08:45:28 +00:00

Avoid compiler casting warnings by assigning to the same type where possible

This saves instructions that are related to casting as well as compiler warnings.
This commit is contained in:
Rose
2023-05-18 14:38:18 -04:00
parent a0b074cc9c
commit e54ba33ea0
50 changed files with 175 additions and 168 deletions

View File

@@ -637,7 +637,7 @@ display_priv_long(struct sudoers_parse_tree *parse_tree, struct passwd *pw,
struct member *m;
if (new_long_entry(cs, prev_cs)) {
int olen;
unsigned int olen;
if (priv->ldap_role != NULL) {
sudo_lbuf_append(lbuf, _("\nLDAP Role: %s\n"),
@@ -717,7 +717,7 @@ display_priv_long(struct sudoers_parse_tree *parse_tree, struct passwd *pw,
if (cs->notbefore != UNSPEC) {
char buf[sizeof("CCYYMMDDHHMMSSZ")] = "";
struct tm gmt;
int len;
size_t len;
if (gmtime_r(&cs->notbefore, &gmt) != NULL) {
len = strftime(buf, sizeof(buf), "%Y%m%d%H%M%SZ", &gmt);
if (len != 0 && buf[sizeof(buf) - 1] == '\0')
@@ -727,7 +727,7 @@ display_priv_long(struct sudoers_parse_tree *parse_tree, struct passwd *pw,
if (cs->notafter != UNSPEC) {
char buf[sizeof("CCYYMMDDHHMMSSZ")] = "";
struct tm gmt;
int len;
size_t len;
if (gmtime_r(&cs->notafter, &gmt) != NULL) {
len = strftime(buf, sizeof(buf), "%Y%m%d%H%M%SZ", &gmt);
if (len != 0 && buf[sizeof(buf) - 1] == '\0')