From: Kern Sibbald Date: Mon, 19 May 2014 17:39:27 +0000 (+0200) Subject: Fix calls to sl.set_string() X-Git-Tag: Release-7.0.4~6 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=828e9e4debe7e335578a0406640dbeb3e899d908;p=bacula%2Fbacula Fix calls to sl.set_string() --- diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index f77fef73e1..f13f090081 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -1454,7 +1454,7 @@ static void delete_job(UAContext *ua) i = find_arg_with_value(ua, NT_("jobid")); if (i >= 0) { - if (sl.set_string(ua->argv[i], true) < 0 && sl.get_errmsg()) { + if (!sl.set_string(ua->argv[i], true)) { ua->warning_msg("%s", sl.get_errmsg()); return; } diff --git a/bacula/src/dird/ua_input.c b/bacula/src/dird/ua_input.c index d8dd4aff1e..421a9e6200 100644 --- a/bacula/src/dird/ua_input.c +++ b/bacula/src/dird/ua_input.c @@ -86,7 +86,7 @@ bool get_selection_list(UAContext *ua, sellist &sl, if (!get_cmd(ua, prompt, subprompt)) { return false; } - if (sl.set_string(ua->cmd, true) < 0 && sl.get_errmsg()) { + if (!sl.set_string(ua->cmd, true)) { ua->send_msg("%s", sl.get_errmsg()); continue; } diff --git a/bacula/src/dird/ua_run.c b/bacula/src/dird/ua_run.c index 45a925879f..4a31ac66d3 100644 --- a/bacula/src/dird/ua_run.c +++ b/bacula/src/dird/ua_run.c @@ -419,7 +419,7 @@ static bool get_jobid_list(UAContext *ua, sellist &sl, run_ctx &rc) ua->send_msg(_("No JobId specified.\n")); return false; } - if (sl.set_string(ua->argv[i], true) < 0 && sl.get_errmsg()) { + if (!sl.set_string(ua->argv[i], true)) { ua->send_msg("%s", sl.get_errmsg()); return false; } diff --git a/bacula/src/dird/ua_select.c b/bacula/src/dird/ua_select.c index 66b27205b0..68904abe59 100644 --- a/bacula/src/dird/ua_select.c +++ b/bacula/src/dird/ua_select.c @@ -1241,7 +1241,7 @@ int select_running_jobs(UAContext *ua, alist *jcrs, const char *reason) sellist sl; int32_t JobId; - if (sl.set_string(ua->argv[i], true) < 0 && sl.get_errmsg()) { + if (!sl.set_string(ua->argv[i], true)) { ua->send_msg("%s", sl.get_errmsg()); break; }