commit b1e73ba2da35aea94d1a0954111196cde121d118
Author: Jim Meyering <meyering(a)redhat.com>
Date: Wed Jun 15 18:23:21 2011 +0200
maint: move a declaration down into sole block where used
* rest.c (proxy_put_attr): Declare "attrval" in inner block.
Remove an unnecessary cast.
rest.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/rest.c b/rest.c
index 6fd0bc7..7a93d49 100644
--- a/rest.c
+++ b/rest.c
@@ -632,7 +632,6 @@ proxy_put_attr (void *cctx, struct MHD_Connection *conn, const char
*url,
{
struct MHD_Response *resp;
my_state *ms = *rctx;
- const char *attrval;
int send_resp = 0;
(void)cctx;
@@ -651,11 +650,11 @@ proxy_put_attr (void *cctx, struct MHD_Connection *conn, const char
*url,
kv_compare, NULL);
if (!ms->dict)
return MHD_NO;
- attrval = MHD_lookup_connection_value(conn,MHD_HEADER_KIND,
- "X-redhat-value");
+ const char *attrval
+ = MHD_lookup_connection_value(conn,MHD_HEADER_KIND,
+ "X-redhat-value");
if (attrval) {
- meta_set_value(ms->bucket,ms->key,ms->attr,
- (char *)attrval);
+ meta_set_value(ms->bucket,ms->key,ms->attr, attrval);
send_resp = 1;
}
}
Show replies by date