From 1307b6f238fb7f4cada95f6af02c1a4caae3eb63 Mon Sep 17 00:00:00 2001 From: Ken Gaillot Date: Fri, 3 Aug 2018 18:30:47 -0500 Subject: [PATCH 1/2] Refactor: scheduler: remove unused variable setting makes static analysis happy --- lib/pengine/container.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/pengine/container.c b/lib/pengine/container.c index d82948a..1526f37 100644 --- a/lib/pengine/container.c +++ b/lib/pengine/container.c @@ -780,7 +780,6 @@ container_fix_remote_addr(resource_t *rsc) } for (int lpc = 0; lpc < DIMOF(attr_list); lpc++) { - name = attr_list[lpc]; value = crm_element_value(rsc->xml, attr_list[lpc]); if (safe_str_eq(value, value_list[lpc]) == FALSE) { return FALSE; -- 1.8.3.1 From 1a95cbae653df8835906314d77e74091f55ab319 Mon Sep 17 00:00:00 2001 From: Ken Gaillot Date: Fri, 3 Aug 2018 18:32:08 -0500 Subject: [PATCH 2/2] Refactor: libcrmcommon: remove dead code makes static analysis happy --- lib/common/iso8601.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/common/iso8601.c b/lib/common/iso8601.c index c95fa13..b661fce 100644 --- a/lib/common/iso8601.c +++ b/lib/common/iso8601.c @@ -1384,7 +1384,7 @@ crm_time_format_hr(const char *format, crm_time_hr_t * hr_dt) { const char *mark_s; int max = 128, scanned_pos = 0, printed_pos = 0, fmt_pos = 0, - date_len = 0, nano_digits = 0, fmt_len; + date_len = 0, nano_digits = 0; char nano_s[10], date_s[max+1], nanofmt_s[5] = "%", *tmp_fmt_s; struct tm tm; crm_time_t dt; @@ -1397,11 +1397,11 @@ crm_time_format_hr(const char *format, crm_time_hr_t * hr_dt) sprintf(nano_s, "%06d000", hr_dt->useconds); while ((format[scanned_pos]) != '\0') { - fmt_len = 0; mark_s = strchr(&format[scanned_pos], '%'); if (mark_s) { + int fmt_len = 1; + fmt_pos = mark_s - format; - fmt_len = 1; while ((format[fmt_pos+fmt_len] != '\0') && (format[fmt_pos+fmt_len] >= '0') && (format[fmt_pos+fmt_len] <= '9')) { -- 1.8.3.1