From f07ebf5475c37077148963dac7dd8b2f3c08851d Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 4 Nov 2020 23:17:21 +0100 Subject: [PATCH 1/5] clients/upsset.c: print_rw(): find use for upsname --- clients/upsset.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clients/upsset.c b/clients/upsset.c index 57ddc2daab..cf7c6a05f6 100644 --- a/clients/upsset.c +++ b/clients/upsset.c @@ -746,6 +746,8 @@ static void print_rw(const char *upsname, const char *varname) { const char *tmp; + printf("\n", upsname); + printf("\n"); printf(""); From bf23ba92f416a5b5e06dba5cad200417a24fec93 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 4 Nov 2020 23:18:52 +0100 Subject: [PATCH 2/5] clients/upsmon.c: sigpipe(): find use for sig --- clients/upsmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/upsmon.c b/clients/upsmon.c index 1bf6939515..b31444d047 100644 --- a/clients/upsmon.c +++ b/clients/upsmon.c @@ -1300,7 +1300,7 @@ static void loadconfig(void) /* SIGPIPE handler */ static void sigpipe(int sig) { - upsdebugx(1, "SIGPIPE: dazed and confused, but continuing..."); + upsdebugx(1, "SIGPIPE: dazed and confused, but continuing after signal %i...", sig); } /* SIGQUIT, SIGTERM handler */ From dca2315fa8fb9a80528726cbc235310f19aa948f Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 4 Nov 2020 23:25:56 +0100 Subject: [PATCH 3/5] clients/upssched.c: main(): find use for argc --- clients/upssched.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/clients/upssched.c b/clients/upssched.c index 09890561ca..8db129ea2e 100644 --- a/clients/upssched.c +++ b/clients/upssched.c @@ -908,9 +908,15 @@ static void checkconf(void) int main(int argc, char **argv) { - const char *prog = xbasename(argv[0]); + const char *prog = NULL; + /* More a use for argc to avoid warnings than a real need: */ + if (argc > 0) { + xbasename(argv[0]); + } else { + xbasename("upssched"); + } - verbose = 1; /* TODO: remove when done testing */ + verbose = 1; /* TODO: remove when done testing, or add -D */ /* normally we don't have stderr, so get this going to syslog early */ open_syslog(prog); From e31c2b6d458783071bfdbd45d7b4ee9c299a3db9 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 5 Nov 2020 02:10:09 +0100 Subject: [PATCH 4/5] drivers/liebert-esp2.c: setvar(): find a use for "val" --- drivers/liebert-esp2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/liebert-esp2.c b/drivers/liebert-esp2.c index 9d1fb7ce6c..ec8538f02a 100644 --- a/drivers/liebert-esp2.c +++ b/drivers/liebert-esp2.c @@ -536,7 +536,7 @@ static int setvar(const char *varname, const char *val) return STAT_SET_HANDLED; } */ - upslogx(LOG_NOTICE, "setvar: unknown variable [%s]", varname); + upslogx(LOG_NOTICE, "setvar: unknown variable [%s] [%s]", varname, val); return STAT_SET_UNKNOWN; } From c1f622ebeef29cc8c47809e973f6938d729809a5 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 5 Nov 2020 02:43:15 +0100 Subject: [PATCH 5/5] drivers/masterguard.c: StringSplit(): use the maxlen --- drivers/masterguard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/masterguard.c b/drivers/masterguard.c index 0180a1bf37..41f7d16856 100644 --- a/drivers/masterguard.c +++ b/drivers/masterguard.c @@ -64,7 +64,7 @@ static char *StringSplit( char *source, char *word, int maxlen ) word[0] = '\0'; len = strlen( source ); - for( i = 0; i < len; i++ ) + for( i = 0; i < len && wc < maxlen; i++ ) { if( source[i] == ' ' ) {