mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-05-12 18:04:39 +08:00
x509_crt: Removed length_as_int intermediate variable
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
This commit is contained in:
parent
59108d3f4d
commit
a9bb34cd73
@ -1541,7 +1541,6 @@ int mbedtls_x509_crt_parse_path(mbedtls_x509_crt *chain, const char *path)
|
|||||||
char filename[MAX_PATH];
|
char filename[MAX_PATH];
|
||||||
char *p;
|
char *p;
|
||||||
size_t len = strlen(path);
|
size_t len = strlen(path);
|
||||||
int length_as_int = 0;
|
|
||||||
|
|
||||||
WIN32_FIND_DATAW file_data;
|
WIN32_FIND_DATAW file_data;
|
||||||
HANDLE hFind;
|
HANDLE hFind;
|
||||||
@ -1557,16 +1556,12 @@ int mbedtls_x509_crt_parse_path(mbedtls_x509_crt *chain, const char *path)
|
|||||||
p = filename + len;
|
p = filename + len;
|
||||||
filename[len++] = '*';
|
filename[len++] = '*';
|
||||||
|
|
||||||
if (FAILED(SizeTToInt(len, &length_as_int))) {
|
|
||||||
return MBEDTLS_ERR_X509_FILE_IO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note this function uses the code page CP_ACP which is the system default
|
* Note this function uses the code page CP_ACP which is the system default
|
||||||
* ANSI codepage. The input string is always described in BYTES and the
|
* ANSI codepage. The input string is always described in BYTES and the
|
||||||
* output length is described in WCHARs.
|
* output length is described in WCHARs.
|
||||||
*/
|
*/
|
||||||
w_ret = MultiByteToWideChar(CP_ACP, 0, filename, length_as_int, szDir,
|
w_ret = MultiByteToWideChar(CP_ACP, 0, filename, (int) len, szDir,
|
||||||
MAX_PATH - 3);
|
MAX_PATH - 3);
|
||||||
if (w_ret == 0) {
|
if (w_ret == 0) {
|
||||||
return MBEDTLS_ERR_X509_BAD_INPUT_DATA;
|
return MBEDTLS_ERR_X509_BAD_INPUT_DATA;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user