X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_config_cores.c;h=94657459f225ed5b83436200cee57b24ee9347b5;hb=b3a6a259606c93ddde88eb23cb26690673663c4b;hp=f280f05a0994ee6a8b50aca3174779a4e7965686;hpb=c0f6e19a1a154f31ce085d0010c164cdef5fbe18;p=collectd.git diff --git a/src/utils_config_cores.c b/src/utils_config_cores.c index f280f05a..94657459 100644 --- a/src/utils_config_cores.c +++ b/src/utils_config_cores.c @@ -1,7 +1,7 @@ /** * collectd - src/utils_config_cores.c * - * Copyright(c) 2017 Intel Corporation. All rights reserved. + * Copyright(c) 2018 Intel Corporation. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -80,7 +80,7 @@ static int str_to_uint(const char *s, unsigned *n) { * Number of elements placed into nums. */ static size_t str_list_to_nums(char *s, unsigned *nums, size_t nums_len) { - char *saveptr; + char *saveptr = NULL; char *token; size_t idx = 0; @@ -163,7 +163,7 @@ static int check_core_grouping(char *out, const char *in, size_t out_size, ERROR(UTIL_NAME ": Missing closing bracket ] in option %s.", in); return -EINVAL; } - if ((end - start) >= out_size) { + if ((size_t)(end - start) >= out_size) { ERROR(UTIL_NAME ": Out buffer is too small."); return -EINVAL; }