minor sign fixes pointed out by gcc -Wsign-compare

This commit is contained in:
Todd C. Miller
2002-11-22 19:11:47 +00:00
parent b152da4cdb
commit fd140ff5da
2 changed files with 18 additions and 17 deletions

View File

@@ -137,7 +137,7 @@ do_syslog(pri, msg)
int pri;
char *msg;
{
int count;
size_t count;
char *p;
char *tmp;
char save;
@@ -188,9 +188,10 @@ do_logfile(msg)
char *beg, *oldend, *end;
FILE *fp;
mode_t oldmask;
int maxlen = def_ival(I_LOGLINELEN);
size_t maxlen;
oldmask = umask(077);
maxlen = def_ival(I_LOGLINELEN) > 0 ? def_ival(I_LOGLINELEN) : 0;
fp = fopen(def_str(I_LOGFILE), "a");
(void) umask(oldmask);
if (fp == NULL) {

View File

@@ -1000,21 +1000,21 @@ dumpaliases()
void
list_matches()
{
int i;
size_t count;
char *p;
struct generic_alias *ga, key;
(void) printf("User %s may run the following commands on this host:\n",
user_name);
for (i = 0; i < cm_list_len; i++) {
for (count = 0; count < cm_list_len; count++) {
/* Print the runas list. */
(void) fputs(" ", stdout);
if (cm_list[i].runas) {
if (cm_list[count].runas) {
(void) putchar('(');
p = strtok(cm_list[i].runas, ", ");
p = strtok(cm_list[count].runas, ", ");
do {
if (p != cm_list[i].runas)
if (p != cm_list[count].runas)
(void) fputs(", ", stdout);
key.alias = p;
@@ -1031,32 +1031,32 @@ list_matches()
}
/* Is a password required? */
if (cm_list[i].nopasswd == TRUE && def_flag(I_AUTHENTICATE))
if (cm_list[count].nopasswd == TRUE && def_flag(I_AUTHENTICATE))
(void) fputs("NOPASSWD: ", stdout);
else if (cm_list[i].nopasswd == FALSE && !def_flag(I_AUTHENTICATE))
else if (cm_list[count].nopasswd == FALSE && !def_flag(I_AUTHENTICATE))
(void) fputs("PASSWD: ", stdout);
/* Print the actual command or expanded Cmnd_Alias. */
key.alias = cm_list[i].cmnd;
key.alias = cm_list[count].cmnd;
key.type = CMND_ALIAS;
if ((ga = (struct generic_alias *) lfind((VOID *) &key,
(VOID *) &ga_list[0], &ga_list_len, sizeof(key), genaliascmp)))
(void) puts(ga->entries);
else
(void) puts(cm_list[i].cmnd);
(void) puts(cm_list[count].cmnd);
}
/* Be nice and free up space now that we are done. */
for (i = 0; i < ga_list_len; i++) {
free(ga_list[i].alias);
free(ga_list[i].entries);
for (count = 0; count < ga_list_len; count++) {
free(ga_list[count].alias);
free(ga_list[count].entries);
}
free(ga_list);
ga_list = NULL;
for (i = 0; i < cm_list_len; i++) {
free(cm_list[i].runas);
free(cm_list[i].cmnd);
for (count = 0; count < cm_list_len; count++) {
free(cm_list[count].runas);
free(cm_list[count].cmnd);
}
free(cm_list);
cm_list = NULL;