mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-06-01 12:15:27 -06:00
Fix Crypto/utils.cpp: extract_file_name
This commit is contained in:
parent
21b6495aaa
commit
39eafc1f3b
@ -147,7 +147,12 @@ void cmac_hash_forge(unsigned char *key, int key_len, unsigned char *in, int in_
|
|||||||
char* extract_file_name(const char* file_path, char real_file_name[MAX_PATH])
|
char* extract_file_name(const char* file_path, char real_file_name[MAX_PATH])
|
||||||
{
|
{
|
||||||
std::string_view v(file_path);
|
std::string_view v(file_path);
|
||||||
v = v.substr(0, v.find_last_of("/\\"));
|
|
||||||
|
if (auto pos = v.find_last_of("/\\"); pos != umax)
|
||||||
|
{
|
||||||
|
v.remove_prefix(pos + 1);
|
||||||
|
}
|
||||||
|
|
||||||
gsl::span r(real_file_name, MAX_PATH);
|
gsl::span r(real_file_name, MAX_PATH);
|
||||||
strcpy_trunc(r, v);
|
strcpy_trunc(r, v);
|
||||||
return real_file_name;
|
return real_file_name;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user