summaryrefslogtreecommitdiff
path: root/lib/librte_kvargs/rte_kvargs.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/librte_kvargs/rte_kvargs.c')
-rw-r--r--lib/librte_kvargs/rte_kvargs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/librte_kvargs/rte_kvargs.c b/lib/librte_kvargs/rte_kvargs.c
index c3d65af..b05a9bc 100644
--- a/lib/librte_kvargs/rte_kvargs.c
+++ b/lib/librte_kvargs/rte_kvargs.c
@@ -48,8 +48,7 @@ int
rte_kvargs_init(struct rte_kvargs *kvlist)
{
kvlist->count = 0;
- kvlist->size = RTE_KVARGS_MAX;
- memset(kvlist->pairs, 0, kvlist->size);
+ memset(kvlist->pairs, 0, sizeof(kvlist->pairs));
return 0;
}
@@ -64,7 +63,7 @@ rte_kvargs_add_pair(struct rte_kvargs *kvlist, char *key, char *val)
struct rte_kvargs_pair* entry;
/* is the list full? */
- if (kvlist->count >= kvlist->size) {
+ if (kvlist->count >= RTE_KVARGS_MAX) {
RTE_LOG(ERR, PMD, "Couldn't add %s, key/value list is full\n", key);
return -1;
}