Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Crypto/utils.cpp: extract_file_name #7694

Merged
merged 1 commit into from Mar 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion rpcs3/Crypto/utils.cpp
Expand Up @@ -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])
{
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);
strcpy_trunc(r, v);
return real_file_name;
Expand Down