From: Alain Spineux Date: Fri, 19 Feb 2021 09:53:09 +0000 (+0100) Subject: Tweak replace MAX_NAME_LENGTH, with a sizeof(variable) in ua_dotcmds.c X-Git-Tag: Release-11.3.2~554 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d34e10c4a64163584ffbffe0e821fbca353ad3a;p=thirdparty%2Fbacula.git Tweak replace MAX_NAME_LENGTH, with a sizeof(variable) in ua_dotcmds.c - 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. --- diff --git a/bacula/src/dird/ua_dotcmds.c b/bacula/src/dird/ua_dotcmds.c index d876b0e9b..bba5ba5be 100644 --- a/bacula/src/dird/ua_dotcmds.c +++ b/bacula/src/dird/ua_dotcmds.c @@ -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 ||