]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbspool: Initialize empty_str on declaration
authorAndreas Schneider <asn@samba.org>
Fri, 5 Jan 2018 09:43:18 +0000 (10:43 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 14 Feb 2018 23:18:29 +0000 (00:18 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/client/smbspool.c

index 3b732c99234dca977a6b7ab9c763c1a3135e6b81..949cdb4076ee4954547be58cbc9c04e5924c5b66 100644 (file)
@@ -94,15 +94,13 @@ main(int argc,                      /* I - Number of command-line arguments */
        FILE           *fp;     /* File to print */
        int             status = 1;     /* Status of LPD job */
        struct cli_state *cli;  /* SMB interface */
-       char            null_str[1];
+       char            empty_str[] = "";
        int             tries = 0;
        bool            need_auth = true;
        const char     *dev_uri;
        const char     *config_file = NULL;
        TALLOC_CTX     *frame = talloc_stackframe();
 
-       null_str[0] = '\0';
-
        if (argc == 1) {
                /*
                 * NEW!  In CUPS 1.1 the backends are run with no arguments
@@ -190,16 +188,16 @@ main(int argc,                    /* I - Number of command-line arguments */
                        *tmp2++ = '\0';
                        password = uri_unescape_alloc(tmp2);
                } else {
-                       password = null_str;
+                       password = empty_str;
                }
                username = uri_unescape_alloc(tmp);
        } else {
                if ((username = getenv("AUTH_USERNAME")) == NULL) {
-                       username = null_str;
+                       username = empty_str;
                }
 
                if ((password = getenv("AUTH_PASSWORD")) == NULL) {
-                       password = null_str;
+                       password = empty_str;
                }
 
                server = uri + 6;