X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Futils_ignorelist.c;h=0ad252bb79336bb6d98e11613a5c03b698a6de58;hp=689b4a42fd7c506f7dd4a4321071a62e9a9705c0;hb=633c3966f770e4d46651a2fe219a18d8a9907a9f;hpb=e0df7ed3f1a6bc3d9164dde7f25b8ed582388a9b diff --git a/src/utils_ignorelist.c b/src/utils_ignorelist.c index 689b4a42..0ad252bb 100644 --- a/src/utils_ignorelist.c +++ b/src/utils_ignorelist.c @@ -1,7 +1,7 @@ /** * collectd - src/utils_ignorelist.c * Copyright (C) 2006 Lubos Stanek - * Copyright (C) 2008 Florian Forster + * Copyright (C) 2008 Florian Forster * * This program is free software; you can redistribute it and/ * or modify it under the terms of the GNU General Public Li- @@ -20,7 +20,7 @@ * * Authors: * Lubos Stanek - * Florian Forster + * Florian Forster **/ /** * ignorelist handles plugin's list of configured collectable @@ -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);