diff options
author | Nathan Scott <nathans@redhat.com> | 2021-07-12 19:11:39 +1000 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2021-07-14 11:58:46 +1000 |
commit | 0daefbe4b452f9373bdfb9950b5b17d01cc77dec (patch) | |
tree | 97fbb6c4c973a89493c346d685ff9f7794de9187 /pcp | |
parent | 9cbee018775439d4296d9281698fdae56649b974 (diff) |
Improve the DynamicMeter_search API to make 'key' optional
Thanks to @BenBE for the suggestion.
Diffstat (limited to 'pcp')
-rw-r--r-- | pcp/PCPDynamicMeter.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pcp/PCPDynamicMeter.c b/pcp/PCPDynamicMeter.c index 2291167f..7cdb24bf 100644 --- a/pcp/PCPDynamicMeter.c +++ b/pcp/PCPDynamicMeter.c @@ -140,8 +140,7 @@ static bool PCPDynamicMeter_validateMeterName(char* key, const char* path, unsig // Ensure a meter name has not been defined previously static bool PCPDynamicMeter_uniqueName(char* key, const char* path, unsigned int line, PCPDynamicMeters* meters) { - unsigned int param = 0; - if (DynamicMeter_search(meters->table, key, ¶m) == false) + if (DynamicMeter_search(meters->table, key, NULL) == false) return true; fprintf(stderr, "%s: duplicate name at %s line %u: \"%s\", ignored\n", @@ -199,6 +198,7 @@ static void PCPDynamicMeter_parseFile(PCPDynamicMeters* meters, const char* path if (caption) { free_and_xStrdup(&meter->super.caption, caption); free(caption); + caption = NULL; } } else if (value && meter && String_eq(key, "description")) { free_and_xStrdup(&meter->super.description, value); |