FIX: MAX_PATH is used within Windows headers, we should use a different define internally

Replace MAX_PATH usage with EMU_MAX_PATH, this prevents the redefine warning, and ensures that we don't mess up other usages (which will likely want MAX_PATH as 260, like Windows defines, not 4096 like we do).
The replacement has been done based on what MSVC was telling me the define values were at each point (i.e. whether we wanted it or not, these usages were using our 4906 value, not the 260 value from Windows)
This commit is contained in:
Bevan Weiss 2020-10-10 18:19:49 +11:00 committed by Ivan
parent e8e3a3b2a2
commit 2c8b3f05ac
3 changed files with 8 additions and 8 deletions

View file

@ -121,7 +121,7 @@ void cmac_hash_forge(unsigned char *key, int key_len, unsigned char *in, int in_
aes_cmac(&ctx, in_len, in, hash);
}
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[CRYPTO_MAX_PATH])
{
std::string_view v(file_path);
@ -130,7 +130,7 @@ char* extract_file_name(const char* file_path, char real_file_name[MAX_PATH])
v.remove_prefix(pos + 1);
}
gsl::span r(real_file_name, MAX_PATH);
gsl::span r(real_file_name, CRYPTO_MAX_PATH);
strcpy_trunc(r, v);
return real_file_name;
}