]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
make_unique_filename() now use "const char *key"
authorAlain Spineux <alain@baculasystems.com>
Wed, 20 May 2020 11:48:29 +0000 (13:48 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:02:57 +0000 (09:02 +0100)
bacula/src/dird/ua_dotcmds.c
bacula/src/lib/bsys.c
bacula/src/lib/ini.c
bacula/src/lib/protos.h

index 1d4b88d49da208d370e832e66bcc19077654c06a..d63e3d9364474ca046ca372baa71f6855e1e9634 100644 (file)
@@ -1670,7 +1670,7 @@ static bool putfile_cmd(UAContext *ua, const char *cmd)
    }
 
    /* the (intptr_t)ua will allow one file per console session */
-   make_unique_filename(&name, (intptr_t)ua, (char *)key);
+   make_unique_filename(&name, (intptr_t)ua, key);
 
    fp = bfopen(name, "w");
    if (!fp) {
index 72539ffdaddc3cd62b6fb9668041db810ddfa06a..97bf72980f66fabdd6dba0f9726d2cf3d1812473 100644 (file)
@@ -942,7 +942,7 @@ char *bfgets(POOLMEM *&s, FILE *fd)
  *   without saving its name, and re-generate the name
  *   so that it can be deleted.
  */
-void make_unique_filename(POOLMEM **name, int Id, char *what)
+void make_unique_filename(POOLMEM **name, int Id, const char *what)
 {
    Mmsg(name, "%s/%s.%s.%d.tmp", working_directory, my_name, what, Id);
 }
index d20ed6411ed2b3285d07985b1145517585a4f3f9..0c9b0ab3284b73df1bfd27d50f483fdf988b7d36 100644 (file)
@@ -178,7 +178,7 @@ bool ConfigFile::dump_string(const char *buf, int32_t len)
 
    if (!out_fname) {
       out_fname = get_pool_memory(PM_FNAME);
-      make_unique_filename(&out_fname, (int)(intptr_t)this, (char*)"configfile");
+      make_unique_filename(&out_fname, (int)(intptr_t)this, "configfile");
    }
 
    fp = bfopen(out_fname, "wb");
index 51fbe34838746b5c52a25784f4b93c399f18a38e..38b69ffba5eb29870596e47bb105d87656ec27fd 100644 (file)
@@ -110,7 +110,7 @@ int change_job_user(char *uname, char *gname, char *errmsg, int errlen);
 int       bmicrosleep            (int32_t sec, int32_t usec);
 char     *bfgets                 (char *s, int size, FILE *fd);
 char     *bfgets                 (POOLMEM *&s, FILE *fd);
-void      make_unique_filename   (POOLMEM **name, int Id, char *what);
+void      make_unique_filename   (POOLMEM **name, int Id, const char *what);
 #ifndef HAVE_STRTOLL
 long long int strtoll            (const char *ptr, char **endptr, int base);
 #endif