mirror of
https://github.com/libretro/RetroArch
synced 2025-02-19 12:41:00 +00:00
fill_str_dated_filename: add size_t return value
This commit is contained in:
parent
0c21a92581
commit
2e5df6a973
@ -517,8 +517,10 @@ size_t fill_dated_filename(char *out_filename,
|
|||||||
*
|
*
|
||||||
* E.g.:
|
* E.g.:
|
||||||
* out_filename = "RetroArch-{year}{month}{day}-{Hour}{Minute}{Second}.{@ext}"
|
* out_filename = "RetroArch-{year}{month}{day}-{Hour}{Minute}{Second}.{@ext}"
|
||||||
|
*
|
||||||
|
* @return Length of the string copied into @out_path
|
||||||
**/
|
**/
|
||||||
void fill_str_dated_filename(char *out_filename,
|
size_t fill_str_dated_filename(char *out_filename,
|
||||||
const char *in_str, const char *ext, size_t size)
|
const char *in_str, const char *ext, size_t size)
|
||||||
{
|
{
|
||||||
char format[NAME_MAX_LENGTH];
|
char format[NAME_MAX_LENGTH];
|
||||||
@ -531,14 +533,11 @@ void fill_str_dated_filename(char *out_filename,
|
|||||||
if (string_is_empty(ext))
|
if (string_is_empty(ext))
|
||||||
{
|
{
|
||||||
strftime(format, sizeof(format), "-%y%m%d-%H%M%S", &tm_);
|
strftime(format, sizeof(format), "-%y%m%d-%H%M%S", &tm_);
|
||||||
strlcat(out_filename, format, size);
|
return strlcat(out_filename, format, size);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
strftime(format, sizeof(format), "-%y%m%d-%H%M%S.", &tm_);
|
|
||||||
strlcat(out_filename, format, size);
|
|
||||||
strlcat(out_filename, ext, size);
|
|
||||||
}
|
}
|
||||||
|
strftime(format, sizeof(format), "-%y%m%d-%H%M%S.", &tm_);
|
||||||
|
strlcat(out_filename, format, size);
|
||||||
|
return strlcat(out_filename, ext, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -830,6 +829,8 @@ end:
|
|||||||
* Both @path and @base are assumed to be absolute paths without "." or "..".
|
* Both @path and @base are assumed to be absolute paths without "." or "..".
|
||||||
*
|
*
|
||||||
* E.g. path /a/b/e/f.cg with base /a/b/c/d/ turns into ../../e/f.cg
|
* E.g. path /a/b/e/f.cg with base /a/b/c/d/ turns into ../../e/f.cg
|
||||||
|
*
|
||||||
|
* @return Length of the string copied into @out
|
||||||
**/
|
**/
|
||||||
size_t path_relative_to(char *out,
|
size_t path_relative_to(char *out,
|
||||||
const char *path, const char *base, size_t size)
|
const char *path, const char *base, size_t size)
|
||||||
|
@ -225,6 +225,8 @@ char *path_resolve_realpath(char *buf, size_t size, bool resolve_symlinks);
|
|||||||
* Both @path and @base are assumed to be absolute paths without "." or "..".
|
* Both @path and @base are assumed to be absolute paths without "." or "..".
|
||||||
*
|
*
|
||||||
* E.g. path /a/b/e/f.cgp with base /a/b/c/d/ turns into ../../e/f.cgp
|
* E.g. path /a/b/e/f.cgp with base /a/b/c/d/ turns into ../../e/f.cgp
|
||||||
|
*
|
||||||
|
* @return Length of the string copied into @out
|
||||||
**/
|
**/
|
||||||
size_t path_relative_to(char *out, const char *path, const char *base,
|
size_t path_relative_to(char *out, const char *path, const char *base,
|
||||||
size_t size);
|
size_t size);
|
||||||
@ -311,8 +313,10 @@ size_t fill_dated_filename(char *out_filename,
|
|||||||
* - Calls string_is_empty()
|
* - Calls string_is_empty()
|
||||||
* - Calls strftime
|
* - Calls strftime
|
||||||
* - Calls strlcat at least 2x
|
* - Calls strlcat at least 2x
|
||||||
|
*
|
||||||
|
* @return Length of the string copied into @out_path
|
||||||
**/
|
**/
|
||||||
void fill_str_dated_filename(char *out_filename,
|
size_t fill_str_dated_filename(char *out_filename,
|
||||||
const char *in_str, const char *ext, size_t size);
|
const char *in_str, const char *ext, size_t size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user