diff options
Diffstat (limited to 'collectors/plugins.d/plugins_d.c')
-rw-r--r-- | collectors/plugins.d/plugins_d.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/collectors/plugins.d/plugins_d.c b/collectors/plugins.d/plugins_d.c index 2916f1c13..377ec1401 100644 --- a/collectors/plugins.d/plugins_d.c +++ b/collectors/plugins.d/plugins_d.c @@ -39,7 +39,7 @@ inline int config_isspace(char c) inline int quoted_strings_splitter(char *str, char **words, int max_words, int (*custom_isspace)(char), char *recover_input, char **recover_location, int max_recover) { char *s = str, quote = 0; - int i = 0, j, rec = 0; + int i = 0, rec = 0; char *recover = recover_input; // skip all white space @@ -112,9 +112,7 @@ inline int quoted_strings_splitter(char *str, char **words, int max_words, int ( } // terminate the words - j = i; - while (likely(j < max_words)) - words[j++] = NULL; + memset(&words[i], 0, (max_words - i) * sizeof (char *)); return i; } |