* If the starting point of the queue is more than half way through,
* move everything toward the beginning.
*/
- if (do_list_queue && (do_list_queue_start == do_list_queue_end)) {
+
+ if (do_list_queue == NULL) {
+ DEBUG(4,("do_list_queue is empty\n"));
+ do_list_queue_start = do_list_queue_end = 0;
+ return;
+ }
+
+ if (do_list_queue_start == do_list_queue_end) {
DEBUG(4,("do_list_queue is empty\n"));
do_list_queue_start = do_list_queue_end = 0;
*do_list_queue = '\0';
msg_port = port ? port : 139;
- if (!(cli=cli_initialise(NULL)) || (cli_set_port(cli, msg_port) != msg_port) ||
+ if (!(cli=cli_initialise()) || (cli_set_port(cli, msg_port) != msg_port) ||
!cli_connect(cli, server_name, &ip)) {
d_printf("Connection to %s failed\n", desthost);
return 1;
set_global_myname( "" );
/* set default debug level to 0 regardless of what smb.conf sets */
- setup_logging( "smbclient", True );
+ setup_logging( "smbctool", True );
DEBUGLEVEL_CLASS[DBGC_ALL] = 1;
- dbf = x_stderr;
- x_setbuf( x_stderr, NULL );
+ if ((dbf = x_fdup(x_stderr))) {
+ x_setbuf( dbf, NULL );
+ }
pc = poptGetContext("smbclient", argc, (const char **) argv, long_options,
POPT_CONTEXT_KEEP_FIRST);
}
break;
case 'E':
+ if (dbf) {
+ x_fclose(dbf);
+ }
dbf = x_stderr;
display_set_stderr();
break;