mirror of
https://github.com/libretro/RetroArch
synced 2025-03-01 16:13:40 +00:00
Made safe version of string concat with delimiter
This commit is contained in:
parent
11b63cbe3d
commit
c83dced0d2
12
file_path.c
12
file_path.c
@ -926,6 +926,18 @@ void fill_pathname_join(char *out_path,
|
||||
rarch_assert(strlcat(out_path, path, size) < size);
|
||||
}
|
||||
|
||||
void fill_pathname_join_delim(char *out_path, const char *dir,
|
||||
const char *path, const char delim, size_t size)
|
||||
{
|
||||
size_t copied = strlcpy(out_path, dir, size);
|
||||
rarch_assert(copied < size+1);
|
||||
|
||||
out_path[copied]=delim;
|
||||
out_path[copied+1] = '\0';
|
||||
|
||||
rarch_assert(strlcat(out_path, path, size) < size);
|
||||
}
|
||||
|
||||
void fill_pathname_expand_special(char *out_path,
|
||||
const char *in_path, size_t size)
|
||||
{
|
||||
|
@ -193,6 +193,10 @@ void fill_pathname_resolve_relative(char *out_path, const char *in_refpath,
|
||||
void fill_pathname_join(char *out_path, const char *dir,
|
||||
const char *path, size_t size);
|
||||
|
||||
/* Joins a directory and path together using the given char. */
|
||||
void fill_pathname_join_delim(char *out_path, const char *dir,
|
||||
const char *path, const char delim, size_t size);
|
||||
|
||||
/* Generates a short representation of path. It should only
|
||||
* be used for displaying the result; the output representation is not
|
||||
* binding in any meaningful way (for a normal path, this is the same as basename)
|
||||
|
Loading…
x
Reference in New Issue
Block a user