Merge pull request #7086 from tom-cosgrove-arm/dont-use-lstrlenW-228

Backport 2.28: Don't use lstrlenW() on Windows
diff --git a/library/x509_crt.c b/library/x509_crt.c
index cb2740f..e7fcaf4 100644
--- a/library/x509_crt.c
+++ b/library/x509_crt.c
@@ -1601,8 +1601,8 @@
         }
 
         w_ret = WideCharToMultiByte(CP_ACP, 0, file_data.cFileName,
-                                    lstrlenW(file_data.cFileName),
-                                    p, (int) len - 1,
+                                    -1,
+                                    p, (int) len,
                                     NULL, NULL);
         if (w_ret == 0) {
             ret = MBEDTLS_ERR_X509_FILE_IO_ERROR;