From: Andreas Schneider Date: Fri, 5 Jan 2018 09:43:18 +0000 (+0100) Subject: smbspool: Initialize empty_str on declaration X-Git-Tag: tevent-0.9.36~90 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=23ec3021224d797ab9d889d8152d8d7774da0226;p=thirdparty%2Fsamba.git smbspool: Initialize empty_str on declaration Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett --- diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c index 3b732c99234..949cdb4076e 100644 --- a/source3/client/smbspool.c +++ b/source3/client/smbspool.c @@ -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;