From 0298f9c14163f0a255662a7bfc4749f82ecb77ff Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sun, 19 Dec 2010 03:09:56 +0100 Subject: libipset: ipset_strncpy is really a strlcpy-type operation --- lib/types.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/types.c') diff --git a/lib/types.c b/lib/types.c index 3034477..d979c24 100644 --- a/lib/types.c +++ b/lib/types.c @@ -54,7 +54,7 @@ ipset_cache_add(const char *name, const struct ipset_type *type, if (n == NULL) return -ENOMEM; - ipset_strncpy(n->name, name, IPSET_MAXNAMELEN); + ipset_strlcpy(n->name, name, IPSET_MAXNAMELEN); n->type = type; n->family = family; n->next = NULL; @@ -133,7 +133,7 @@ ipset_cache_rename(const char *from, const char *to) for (s = setlist; s != NULL; s = s->next) { if (STREQ(s->name, from)) { - ipset_strncpy(s->name, to, IPSET_MAXNAMELEN); + ipset_strlcpy(s->name, to, IPSET_MAXNAMELEN); return 0; } } @@ -164,8 +164,8 @@ ipset_cache_swap(const char *from, const char *to) b = s; } if (a != NULL && b != NULL) { - ipset_strncpy(a->name, to, IPSET_MAXNAMELEN); - ipset_strncpy(b->name, from, IPSET_MAXNAMELEN); + ipset_strlcpy(a->name, to, IPSET_MAXNAMELEN); + ipset_strlcpy(b->name, from, IPSET_MAXNAMELEN); return 0; } -- cgit v1.2.3