summaryrefslogtreecommitdiff
path: root/crypto/getenv.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/getenv.c')
-rw-r--r--crypto/getenv.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/crypto/getenv.c b/crypto/getenv.c
index e79b6cc1618f..b2a2e85c8586 100644
--- a/crypto/getenv.c
+++ b/crypto/getenv.c
@@ -8,7 +8,7 @@
*/
#ifndef _GNU_SOURCE
-# define _GNU_SOURCE
+#define _GNU_SOURCE
#endif
#include <stdlib.h>
@@ -34,10 +34,7 @@ char *ossl_safe_getenv(const char *name)
* For the code pages listed below, dwFlags must be set to 0.
* Otherwise, the function fails with ERROR_INVALID_FLAGS.
*/
- if (curacp == 50220 || curacp == 50221 || curacp == 50222 ||
- curacp == 50225 || curacp == 50227 || curacp == 50229 ||
- (57002 <= curacp && curacp <=57011) || curacp == 65000 ||
- curacp == 42)
+ if (curacp == 50220 || curacp == 50221 || curacp == 50222 || curacp == 50225 || curacp == 50227 || curacp == 50229 || (57002 <= curacp && curacp <= 57011) || curacp == 65000 || curacp == 42)
dwFlags = 0;
/* query for buffer len */
@@ -62,7 +59,7 @@ char *ossl_safe_getenv(const char *name)
if (GetEnvironmentVariableW(namew, valw, envlen) < envlen) {
/* determine value string size in utf-8 */
vallen = WideCharToMultiByte(CP_UTF8, 0, valw, -1, NULL, 0,
- NULL, NULL);
+ NULL, NULL);
}
}
@@ -72,7 +69,8 @@ char *ossl_safe_getenv(const char *name)
if (NULL != val) {
/* convert value string from wide to utf-8 */
if (WideCharToMultiByte(CP_UTF8, 0, valw, -1, val, vallen,
- NULL, NULL) == 0) {
+ NULL, NULL)
+ == 0) {
OPENSSL_free(val);
val = NULL;
}
@@ -89,10 +87,10 @@ char *ossl_safe_getenv(const char *name)
#endif
#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
-# if __GLIBC_PREREQ(2, 17)
-# define SECURE_GETENV
+#if __GLIBC_PREREQ(2, 17)
+#define SECURE_GETENV
return secure_getenv(name);
-# endif
+#endif
#endif
#ifndef SECURE_GETENV