From 7b36ca1971d9761e1b5f18e2562141353ef9f006 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Sun, 12 Apr 2009 14:59:08 +0000 Subject: [PATCH] remove dead code Remove some more dead code assignment - where the variable is immediately assigned in the next statement - or not used at all. ticket: 6453 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22195 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/rcache/rc_conv.c | 2 +- src/lib/krb5/rcache/ser_rc.c | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/lib/krb5/rcache/rc_conv.c b/src/lib/krb5/rcache/rc_conv.c index 2684929a6..cda9c91fa 100644 --- a/src/lib/krb5/rcache/rc_conv.c +++ b/src/lib/krb5/rcache/rc_conv.c @@ -67,7 +67,7 @@ krb5_rc_hash_message(krb5_context context, const krb5_data *message, krb5_free_checksum_contents(context, &cksum); return KRB5_RC_MALLOC; } - ptr = hash; + for (i = 0, ptr = hash; i < cksum.length; i++, ptr += 2) snprintf(ptr, 3, "%02X", cksum.contents[i]); *ptr = '\0'; diff --git a/src/lib/krb5/rcache/ser_rc.c b/src/lib/krb5/rcache/ser_rc.c index 148ec5d78..77a3e21bb 100644 --- a/src/lib/krb5/rcache/ser_rc.c +++ b/src/lib/krb5/rcache/ser_rc.c @@ -102,7 +102,6 @@ krb5_rcache_externalize(krb5_context kcontext, krb5_pointer arg, krb5_octet **bu krb5_octet *bp; size_t remain; char *rcname; - size_t namelen; char *fnamep; required = 0; @@ -116,11 +115,7 @@ krb5_rcache_externalize(krb5_context kcontext, krb5_pointer arg, krb5_octet **bu /* Our identifier */ (void) krb5_ser_pack_int32(KV5M_RCACHE, &bp, &remain); - /* Calculate the length of the name */ - namelen = (rcache->ops && rcache->ops->type) ? - strlen(rcache->ops->type)+1 : 0; fnamep = krb5_rc_get_name(kcontext, rcache); - namelen += (strlen(fnamep)+1); if (rcache->ops && rcache->ops->type) { if (asprintf(&rcname, "%s:%s", rcache->ops->type, fnamep) < 0) @@ -170,7 +165,6 @@ krb5_rcache_internalize(krb5_context kcontext, krb5_pointer *argp, krb5_octet ** if (krb5_ser_unpack_int32(&ibuf, &bp, &remain)) ibuf = 0; if (ibuf == KV5M_RCACHE) { - kret = ENOMEM; /* Get the length of the rcache name */ kret = krb5_ser_unpack_int32(&ibuf, &bp, &remain); -- 2.26.2