Skip to content

Commit 20da3da

Browse files
httpstormmattcaswell
authored andcommitted
o_fopen: fix coding style and build error with VS2010
Follow the coding style to place variable definitions before code Fixes a build error on Windows 2003 with VS2010 introduced in [1] crypto\o_fopen.c(45) : error C2143: syntax error : missing ';' before 'type' crypto\o_fopen.c(46) : error C2275: 'DWORD' : illegal use of this type as an expression E:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\windef.h(152) : see declaration of 'DWORD' crypto\o_fopen.c(46) : error C2146: syntax error : missing ';' before identifier 'flags' crypto\o_fopen.c(46) : error C2065: 'flags' : undeclared identifier [1] openssl@917f371 Signed-off-by: Georgi Valkov <[email protected]> Reviewed-by: Tom Cosgrove <[email protected]> Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Matt Caswell <[email protected]> (Merged from openssl#24853)
1 parent b24a820 commit 20da3da

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

crypto/o_fopen.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,15 @@
3838
FILE *openssl_fopen(const char *filename, const char *mode)
3939
{
4040
FILE *file = NULL;
41+
# if defined(_WIN32) && defined(CP_UTF8)
42+
int sz, len_0;
43+
DWORD flags;
44+
# endif
4145

4246
if (filename == NULL)
4347
return NULL;
4448
# if defined(_WIN32) && defined(CP_UTF8)
45-
int sz, len_0 = (int)strlen(filename) + 1;
46-
DWORD flags;
49+
len_0 = (int)strlen(filename) + 1;
4750

4851
/*
4952
* Basically there are three cases to cover: a) filename is

0 commit comments

Comments
 (0)