Set error code, no fprintf stderr, on errors.
[openssl.git] / crypto / bio / bss_file.c
index 0776383448e6c1c93b657faca5d55efaa498d1c8..cebad7545675083758bfbe36376ad1773a642b52 100644 (file)
@@ -85,7 +85,7 @@
 
 # include <stdio.h>
 # include <errno.h>
-# include "cryptlib.h"
+# include "internal/cryptlib.h"
 # include "bio_lcl.h"
 # include <openssl/err.h>
 
@@ -148,7 +148,7 @@ BIO *BIO_new_file(const char *filename, const char *mode)
         if (MultiByteToWideChar(CP_UTF8, flags,
                                 filename, len_0, wfilename, sz) &&
             MultiByteToWideChar(CP_UTF8, 0, mode, strlen(mode) + 1,
-                                wmode, sizeof(wmode) / sizeof(wmode[0])) &&
+                                wmode, OSSL_NELEM(wmode)) &&
             (file = _wfopen(wfilename, wmode)) == NULL &&
             (errno == ENOENT || errno == EBADF)
             ) {