From: Thomas Jarosch Date: Wed, 8 Jun 2005 18:45:23 +0000 (+0000) Subject: compile fixes X-Git-Tag: v1.3~3 X-Git-Url: http://developer.intra2net.com/git/?p=libipt_ACCOUNT;a=commitdiff_plain;h=28ea7aa88ae4a637ddd402bd955dbf42d4fd3b64 compile fixes --- diff --git a/iptaccount/iptaccount.c b/iptaccount/iptaccount.c index 4854efd..91e4bbf 100644 --- a/iptaccount/iptaccount.c +++ b/iptaccount/iptaccount.c @@ -61,6 +61,7 @@ int main(int argc, char *argv[]) doFlush=0, doContinue=0; char *table_name = NULL; + const char *name; printf("\nipt_ACCOUNT userspace accounting tool v%s\n\n", VERSION); @@ -157,7 +158,6 @@ int main(int argc, char *argv[]) printf("get_table_names failed: %s\n", ctx.error_str); exit (-1); } - const char *name; while ((name = ipt_ACCOUNT_get_next_name(&ctx)) != 0) printf("Found table: %s\n", name); } diff --git a/src/ipt_ACCOUNT_cl.c b/src/ipt_ACCOUNT_cl.c index 0d8d4d8..a1925ec 100644 --- a/src/ipt_ACCOUNT_cl.c +++ b/src/ipt_ACCOUNT_cl.c @@ -69,6 +69,7 @@ int ipt_ACCOUNT_read_entries(struct ipt_ACCOUNT_context *ctx, const char *table, char dont_flush) { unsigned int s = sizeof (struct ipt_acc_handle_sockopt); + unsigned int new_size; int rtn; strncpy(ctx->handle.name, table, ACCOUNT_TABLE_NAME_LEN-1); @@ -89,7 +90,6 @@ int ipt_ACCOUNT_read_entries(struct ipt_ACCOUNT_context *ctx, // Check data buffer size ctx->pos = 0; - unsigned int new_size; new_size = ctx->handle.itemcount * sizeof(struct ipt_acc_handle_ip); // We want to prevent reallocations all the time if (new_size < IPT_ACCOUNT_MIN_BUFSIZE) @@ -185,10 +185,11 @@ int ipt_ACCOUNT_get_table_names(struct ipt_ACCOUNT_context *ctx) const char *ipt_ACCOUNT_get_next_name(struct ipt_ACCOUNT_context *ctx) { + const char *rtn; if (((char *)ctx->data)[ctx->pos] == 0) return 0; - const char *rtn = ctx->data + ctx->pos; + rtn = ctx->data + ctx->pos; ctx->pos += strlen(ctx->data+ctx->pos) + 1; return rtn;