diff options
Diffstat (limited to 'lib/types.c')
-rw-r--r-- | lib/types.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/types.c b/lib/types.c index 3034477..1bd4274 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; } @@ -393,7 +393,7 @@ ipset_type_get(struct ipset_session *session, enum ipset_cmd cmd) const struct ipset_type * ipset_type_check(struct ipset_session *session) { - struct ipset_type *t, *match = NULL; + const struct ipset_type *t, *match = NULL; struct ipset_data *data; const char *typename; uint8_t family, revision; |