Add -Wshadow and deal with the warnings.
This commit is contained in:
10
kcm/config.c
10
kcm/config.c
@@ -328,11 +328,11 @@ void
|
||||
kcm_configure(int argc, char **argv)
|
||||
{
|
||||
krb5_error_code ret;
|
||||
int optind = 0;
|
||||
int optidx = 0;
|
||||
const char *p;
|
||||
|
||||
while(getarg(args, num_args, argc, argv, &optind))
|
||||
warnx("error at argument `%s'", argv[optind]);
|
||||
while(getarg(args, num_args, argc, argv, &optidx))
|
||||
warnx("error at argument `%s'", argv[optidx]);
|
||||
|
||||
if(help_flag)
|
||||
usage (0);
|
||||
@@ -342,8 +342,8 @@ kcm_configure(int argc, char **argv)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
argc -= optidx;
|
||||
argv += optidx;
|
||||
|
||||
if (argc != 0)
|
||||
usage(1);
|
||||
|
@@ -61,10 +61,10 @@ kcm_enqueue_event(krb5_context context,
|
||||
}
|
||||
|
||||
static void
|
||||
print_times(time_t time, char buf[64])
|
||||
print_times(time_t t, char buf[64])
|
||||
{
|
||||
if (time)
|
||||
strftime(buf, 64, "%m-%dT%H:%M", gmtime(&time));
|
||||
if (t)
|
||||
strftime(buf, 64, "%m-%dT%H:%M", gmtime(&t));
|
||||
else
|
||||
strlcpy(buf, "never", 64);
|
||||
}
|
||||
|
12
kcm/log.c
12
kcm/log.c
@@ -35,30 +35,30 @@
|
||||
|
||||
RCSID("$Id$");
|
||||
|
||||
static krb5_log_facility *logf;
|
||||
static krb5_log_facility *logfac;
|
||||
|
||||
void
|
||||
kcm_openlog(void)
|
||||
{
|
||||
char **s = NULL, **p;
|
||||
krb5_initlog(kcm_context, "kcm", &logf);
|
||||
krb5_initlog(kcm_context, "kcm", &logfac);
|
||||
s = krb5_config_get_strings(kcm_context, NULL, "kcm", "logging", NULL);
|
||||
if(s == NULL)
|
||||
s = krb5_config_get_strings(kcm_context, NULL, "logging", "kcm", NULL);
|
||||
if(s){
|
||||
for(p = s; *p; p++)
|
||||
krb5_addlog_dest(kcm_context, logf, *p);
|
||||
krb5_addlog_dest(kcm_context, logfac, *p);
|
||||
krb5_config_free_strings(s);
|
||||
}else
|
||||
krb5_addlog_dest(kcm_context, logf, DEFAULT_LOG_DEST);
|
||||
krb5_set_warn_dest(kcm_context, logf);
|
||||
krb5_addlog_dest(kcm_context, logfac, DEFAULT_LOG_DEST);
|
||||
krb5_set_warn_dest(kcm_context, logfac);
|
||||
}
|
||||
|
||||
char*
|
||||
kcm_log_msg_va(int level, const char *fmt, va_list ap)
|
||||
{
|
||||
char *msg;
|
||||
krb5_vlog_msg(kcm_context, logf, &msg, level, fmt, ap);
|
||||
krb5_vlog_msg(kcm_context, logfac, &msg, level, fmt, ap);
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
@@ -1497,7 +1497,7 @@ kcm_op_do_ntlm(krb5_context context,
|
||||
*/
|
||||
|
||||
if (1 || type2.targetinfo.length == 0) {
|
||||
struct ntlm_buf sessionkey;
|
||||
struct ntlm_buf tmpsesskey;
|
||||
|
||||
if (type2.flags & NTLM_NEG_NTLM2_SESSION) {
|
||||
unsigned char nonce[8];
|
||||
@@ -1524,7 +1524,7 @@ kcm_op_do_ntlm(krb5_context context,
|
||||
|
||||
ret = heim_ntlm_build_ntlm1_master(c->nthash.data,
|
||||
c->nthash.length,
|
||||
&sessionkey,
|
||||
&tmpsesskey,
|
||||
&type3.sessionkey);
|
||||
if (ret) {
|
||||
if (type3.lm.data)
|
||||
@@ -1534,7 +1534,7 @@ kcm_op_do_ntlm(krb5_context context,
|
||||
goto error;
|
||||
}
|
||||
|
||||
free(sessionkey.data);
|
||||
free(tmpsesskey.data);
|
||||
if (ret) {
|
||||
if (type3.lm.data)
|
||||
free(type3.lm.data);
|
||||
|
Reference in New Issue
Block a user