X-Git-Url: http://developer.intra2net.com/git/?a=blobdiff_plain;f=src%2Fipt_ACCOUNT_cl.c;h=8ef3277f3ed48b8ad68eecf5280b730678e1bdb6;hb=303a100df399261ab98852b23e1619ee5483f4a9;hp=0d8d4d84dd7f1a09af9669b9c73abd8bf19d9fe5;hpb=a92b7b942ef323f4c58f7e9d4801cd8253417da4;p=libipt_ACCOUNT diff --git a/src/ipt_ACCOUNT_cl.c b/src/ipt_ACCOUNT_cl.c index 0d8d4d8..8ef3277 100644 --- a/src/ipt_ACCOUNT_cl.c +++ b/src/ipt_ACCOUNT_cl.c @@ -16,6 +16,9 @@ #include #include +#include +#include + int ipt_ACCOUNT_init(struct ipt_ACCOUNT_context *ctx) { memset (ctx, 0, sizeof(struct ipt_ACCOUNT_context)); @@ -69,6 +72,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 +93,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 +188,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;