diff --git a/src/types_list.c b/src/types_list.c
index 3be792d5ca11bbd741f9b599a517c9cfea7da9ac..a9af9e6d29f783eeed53f8fb1836414511d77ac4 100644 (file)
--- a/src/types_list.c
+++ b/src/types_list.c
return (-1);
}
- strncpy (dsrc->name, fields[0], sizeof (dsrc->name));
- dsrc->name[sizeof (dsrc->name) - 1] = '\0';
+ sstrncpy (dsrc->name, fields[0], sizeof (dsrc->name));
if (strcasecmp (fields[1], "GAUGE") == 0)
dsrc->type = DS_TYPE_GAUGE;
memset (ds, '\0', sizeof (data_set_t));
- strncpy (ds->type, fields[0], sizeof (ds->type));
- ds->type[sizeof (ds->type) - 1] = '\0';
+ sstrncpy (ds->type, fields[0], sizeof (ds->type));
ds->ds_num = fields_num - 1;
ds->ds = (data_source_t *) calloc (ds->ds_num, sizeof (data_source_t));