From 828e9e4debe7e335578a0406640dbeb3e899d908 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Mon, 19 May 2014 19:39:27 +0200 Subject: [PATCH] Fix calls to sl.set_string() --- bacula/src/dird/ua_cmds.c | 2 +- bacula/src/dird/ua_input.c | 2 +- bacula/src/dird/ua_run.c | 2 +- bacula/src/dird/ua_select.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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; } -- 2.39.5