s3: net_share.c: fix argc handling
authorHolger Hetterich <hhetter@novell.com>
Tue, 2 Mar 2010 22:17:20 +0000 (23:17 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 2 Mar 2010 23:27:58 +0000 (15:27 -0800)
The "net share" command was no longer possible because it enters
the net_share function with argc == 0.

source3/utils/net_share.c

index db06b7d35a558c35f25f53556c9aa4d7d31943f2..156b27b572a2506401b9d55758c176d2c584c212 100644 (file)
@@ -62,12 +62,9 @@ int net_share_usage(struct net_context *c, int argc, const char **argv)
 
 int net_share(struct net_context *c, int argc, const char **argv)
 {
-       if (argc < 1)
-               return net_share_usage(c, argc, argv);
-
-       if (StrCaseCmp(argv[0], "HELP") == 0) {
-               net_share_usage(c, argc, argv);
-               return 0;
+       if (argc > 0 && StrCaseCmp(argv[0], "HELP") == 0) {
+                       net_share_usage(c, argc, argv);
+                       return 0;
        }
 
        if (net_rpc_check(c, 0))