From eecf7791736228cd0b087b11810bc4ba96d4d022 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Fri, 23 Jan 2009 05:02:07 +0000 Subject: [PATCH] Per coding standards, don't declare variables in inner scopes in new rcache code except when it really makes sense (option processing for t_replay). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21781 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/rcache/rc_dfl.c | 6 ++---- src/lib/krb5/rcache/t_replay.c | 10 ++++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/lib/krb5/rcache/rc_dfl.c b/src/lib/krb5/rcache/rc_dfl.c index db76b2344..048616208 100644 --- a/src/lib/krb5/rcache/rc_dfl.c +++ b/src/lib/krb5/rcache/rc_dfl.c @@ -658,8 +658,8 @@ krb5_rc_io_store(krb5_context context, struct dfl_data *t, size_t clientlen, serverlen; unsigned int len; krb5_error_code ret; - struct k5buf buf; - char *ptr; + struct k5buf buf, extbuf; + char *ptr, *extstr; clientlen = strlen(rep->client); serverlen = strlen(rep->server); @@ -670,8 +670,6 @@ krb5_rc_io_store(krb5_context context, struct dfl_data *t, * in regular format (without the message hash) for the * benefit of old implementations. */ - struct k5buf extbuf; - char *extstr; /* Format the extension value so we know its length. */ krb5int_buf_init_dynamic(&extbuf); diff --git a/src/lib/krb5/rcache/t_replay.c b/src/lib/krb5/rcache/t_replay.c index 0af8aff99..d32d6547c 100644 --- a/src/lib/krb5/rcache/t_replay.c +++ b/src/lib/krb5/rcache/t_replay.c @@ -68,6 +68,9 @@ static void dump_rcache(const char *filename) FILE *fp; krb5_deltat lifespan; krb5_int16 vno; + char *str; + krb5_int32 usec; + krb5_timestamp timestamp; fp = fopen(filename, "r"); if (!fp) { @@ -80,10 +83,6 @@ static void dump_rcache(const char *filename) return; printf("Lifespan: %ld\n", (long) lifespan); while (1) { - char *str; - krb5_int32 usec; - krb5_timestamp timestamp; - printf("---\n"); if (!(str = read_counted_string(fp))) @@ -114,6 +113,7 @@ static void store(krb5_context ctx, char *rcspec, char *client, char *server, krb5_error_code retval = 0; char *hash = NULL; krb5_donot_replay rep; + krb5_data d; if (now_timestamp > 0) krb5_set_debugging_time(ctx, now_timestamp, now_usec); @@ -122,8 +122,6 @@ static void store(krb5_context ctx, char *rcspec, char *client, char *server, if ((retval = krb5_rc_recover_or_initialize(ctx, rc, ctx->clockskew))) goto cleanup; if (msg) { - krb5_data d; - d.data = msg; d.length = strlen(msg); if ((retval = krb5_rc_hash_message(ctx, &d, &hash))) -- 2.26.2