1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

s3:smbcontrol: avoid printing NULL help strings

Some smbcontrol commands leave the .help pointer NULL, resulting in the
following usage text:
        disconnect-dc                 (null)
        notify-cleanup                (null)
	...
        msg-cleanup                   (null)

Improve this by printing an empty string instead.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Mon Sep  9 10:32:53 UTC 2019 on sn-devel-184
This commit is contained in:
David Disseldorp 2019-09-08 15:08:54 +02:00
parent 3bd68261ec
commit 560c3abf45

View File

@ -1562,9 +1562,13 @@ static void usage(poptContext pc)
fprintf(stderr, "\n");
fprintf(stderr, "<message-type> is one of:\n");
for (i = 0; msg_types[i].name; i++)
fprintf(stderr, "\t%-30s%s\n", msg_types[i].name,
msg_types[i].help);
for (i = 0; msg_types[i].name; i++) {
const char *help = msg_types[i].help;
if (help == NULL) {
help = "";
}
fprintf(stderr, "\t%-30s%s\n", msg_types[i].name, help);
}
fprintf(stderr, "\n");