summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2020-05-28 22:02:33 +0800
committerMatt Johnston <matt@ucc.asn.au>2020-05-28 22:02:33 +0800
commit5027bc4db18a50aebd70bf4ae41f7702469c01ba (patch)
treedb155bebb6eda743bdc0420fe064c6e6c7a1a461
parent630f6aa6b94788f04fb728c71cade2d1092a7c45 (diff)
set up early logging name
-rw-r--r--cli-main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/cli-main.c b/cli-main.c
index b43b1e2..aabbbcd 100644
--- a/cli-main.c
+++ b/cli-main.c
@@ -131,6 +131,12 @@ static void cli_dropbear_log(int priority,
const char* format, va_list param) {
char printbuf[1024];
+ const char *name;
+
+ name = cli_opts.progname;
+ if (!name) {
+ name = "dbclient";
+ }
vsnprintf(printbuf, sizeof(printbuf), format, param);
@@ -140,7 +146,7 @@ static void cli_dropbear_log(int priority,
}
#endif
- fprintf(stderr, "%s: %s\n", cli_opts.progname, printbuf);
+ fprintf(stderr, "%s: %s\n", name, printbuf);
fflush(stderr);
}