The branch, master has been updated
       via  560c3abf453 s3:smbcontrol: avoid printing NULL help strings
      from  3bd68261eca ctdb-eventscripts: Remove non-posix -v option to mkdir

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 560c3abf453597794e5ddf3782bc05d8ba4e5299
Author: David Disseldorp <[email protected]>
Date:   Sun Sep 8 15:08:54 2019 +0200

    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 <[email protected]>
    Reviewed-by: Douglas Bagnall <[email protected]>
    
    Autobuild-User(master): David Disseldorp <[email protected]>
    Autobuild-Date(master): Mon Sep  9 10:32:53 UTC 2019 on sn-devel-184

-----------------------------------------------------------------------

Summary of changes:
 source3/utils/smbcontrol.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c
index 739ee93e28b..1435cc57d0a 100644
--- a/source3/utils/smbcontrol.c
+++ b/source3/utils/smbcontrol.c
@@ -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");
 


-- 
Samba Shared Repository

Reply via email to