From: Florian Forster Date: Fri, 3 Oct 2008 21:14:44 +0000 (+0200) Subject: Merge branch 'collectd-4.4' into collectd-4.5 X-Git-Tag: collectd-4.5.1~8 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b2a7cb85e09f67cbaf114eb64bf736f3a24d9d55;p=collectd.git Merge branch 'collectd-4.4' into collectd-4.5 Conflicts: src/utils_ignorelist.c --- b2a7cb85e09f67cbaf114eb64bf736f3a24d9d55 diff --cc src/utils_ignorelist.c index db679dad,689b4a42..de42d0fa --- a/src/utils_ignorelist.c +++ b/src/utils_ignorelist.c @@@ -306,12 -306,13 +306,12 @@@ int ignorelist_add (ignorelist_t *il, c if ((entry_len > 2) && (entry[0] == '/') && entry[entry_len - 1] == '/') { char *entry_copy; + size_t entry_copy_size; /* We need to copy `entry' since it's const */ - entry_copy = smalloc (entry_len); - memset (entry_copy, '\0', entry_len); - /* sstrncpy() overwrites the trailing '/' */ - sstrncpy (entry_copy, entry + 1, entry_len - 1); + 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);