summaryrefslogtreecommitdiffstats
path: root/lib/types.c
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2010-12-20 11:54:26 +0100
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2010-12-20 11:54:35 +0100
commit57d871ad46bfaed44e556cb872f4bfab1004d9e1 (patch)
tree05aba4c451f5d6a7025db633d22c556f55d9f351 /lib/types.c
parent06366c172c487b3038b52e8fe640747b4092a544 (diff)
parent95b9dfb393232f384ccfc671971a0a9387e138d4 (diff)
Merge branch 'master' of git://dev.medozas.de/ipset into ipset-5
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Diffstat (limited to 'lib/types.c')
-rw-r--r--lib/types.c10
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;