]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Tweak replace MAX_NAME_LENGTH, with a sizeof(variable) in ua_dotcmds.c
authorAlain Spineux <alain@baculasystems.com>
Fri, 19 Feb 2021 09:53:09 +0000 (10:53 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:01 +0000 (09:03 +0100)
- we use a sizeof() for the exact same use few lines above
- Yes, I didn't remove the "exact same lines above" because I'm not
  sure that it will not brake something.

bacula/src/dird/ua_dotcmds.c

index d876b0e9b0c764ababaa61a0f5a66be8379006ef..bba5ba5be090ada313cf15798fec9cadbb69f9a1 100644 (file)
@@ -1451,7 +1451,7 @@ static bool dot_bvfs_get_jobids(UAContext *ua, const char *cmd)
 
    /* Get JobId from ujobid */
    } else if ((pos = find_arg_with_value(ua, "ujobid")) >= 0) {
-      bstrncpy(jr.Job, ua->argv[pos], MAX_NAME_LENGTH);
+      bstrncpy(jr.Job, ua->argv[pos], sizeof(jr.Job));
 
    /* Return all backup jobid for a client list */
    } else if ((pos = find_arg_with_value(ua, "client")) >= 0 ||