X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_ignorelist.c;h=de42d0fa399035e0f2e3930866d2be670557fc72;hb=204cf4f8f68cadeac474a75584f27b7339aca4c4;hp=689b4a42fd7c506f7dd4a4321071a62e9a9705c0;hpb=e0df7ed3f1a6bc3d9164dde7f25b8ed582388a9b;p=collectd.git diff --git a/src/utils_ignorelist.c b/src/utils_ignorelist.c index 689b4a42..de42d0fa 100644 --- a/src/utils_ignorelist.c +++ b/src/utils_ignorelist.c @@ -311,8 +311,7 @@ int ignorelist_add (ignorelist_t *il, const char *entry) /* We need to copy `entry' since it's const */ entry_copy_size = entry_len - 1; entry_copy = smalloc (entry_copy_size); - strncpy (entry_copy, entry + 1, entry_copy_size); - entry_copy[entry_copy_size - 1] = 0; + sstrncpy (entry_copy, entry + 1, entry_copy_size); DEBUG("I'm about to add regex entry: %s", entry_copy); ret = ignorelist_append_regex(il, entry_copy);