diff options
Diffstat (limited to 'crypto/openssl/apps/lib/win32_init.c')
| -rw-r--r-- | crypto/openssl/apps/lib/win32_init.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/crypto/openssl/apps/lib/win32_init.c b/crypto/openssl/apps/lib/win32_init.c index 6d2be0c62942..0ea2048283cb 100644 --- a/crypto/openssl/apps/lib/win32_init.c +++ b/crypto/openssl/apps/lib/win32_init.c @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -10,7 +10,6 @@ #include <windows.h> #include <stdlib.h> #include <string.h> -#include <malloc.h> #if defined(CP_UTF8) @@ -81,18 +80,18 @@ static int process_glob(WCHAR *wstr, int wlen) break; if (i == wlen) - return 0; /* definitely not a glob */ + return 0; /* definitely not a glob */ saved_char = wstr[wlen]; wstr[wlen] = L'\0'; h = FindFirstFileW(wstr, &data); wstr[wlen] = saved_char; if (h == INVALID_HANDLE_VALUE) - return 0; /* not a valid glob, just pass... */ + return 0; /* not a valid glob, just pass... */ if (slash) udlen = WideCharToMultiByte(CP_UTF8, 0, wstr, slash, - NULL, 0, NULL, NULL); + NULL, 0, NULL, NULL); else udlen = 0; @@ -104,8 +103,7 @@ static int process_glob(WCHAR *wstr, int wlen) * skip over . and .. */ if (data.cFileName[0] == L'.') { - if ((data.cFileName[1] == L'\0') || - (data.cFileName[1] == L'.' && data.cFileName[2] == L'\0')) + if ((data.cFileName[1] == L'\0') || (data.cFileName[1] == L'.' && data.cFileName[2] == L'\0')) continue; } @@ -117,7 +115,7 @@ static int process_glob(WCHAR *wstr, int wlen) * so that |uflen| covers even trailing '\0'. */ uflen = WideCharToMultiByte(CP_UTF8, 0, data.cFileName, -1, - NULL, 0, NULL, NULL); + NULL, 0, NULL, NULL); arg = malloc(udlen + uflen); if (arg == NULL) @@ -125,10 +123,10 @@ static int process_glob(WCHAR *wstr, int wlen) if (udlen) WideCharToMultiByte(CP_UTF8, 0, wstr, slash, - arg, udlen, NULL, NULL); + arg, udlen, NULL, NULL); WideCharToMultiByte(CP_UTF8, 0, data.cFileName, -1, - arg + udlen, uflen, NULL, NULL); + arg + udlen, uflen, NULL, NULL); newargv[newargc++] = arg; } while (FindNextFileW(h, &data)); @@ -154,7 +152,8 @@ void win32_utf8argv(int *argc, char **argv[]) return; wcmdline = GetCommandLineW(); - if (wcmdline == NULL) return; + if (wcmdline == NULL) + return; /* * make a copy of the command line, since we might have to modify it... @@ -178,7 +177,7 @@ void win32_utf8argv(int *argc, char **argv[]) */ warg = wend = p; while (*p != L'\0' - && (in_quote || (*p != L' ' && *p != L'\t'))) { + && (in_quote || (*p != L' ' && *p != L'\t'))) { switch (*p) { case L'\\': /* @@ -259,7 +258,7 @@ void win32_utf8argv(int *argc, char **argv[]) ulen = 0; if (wlen > 0) { ulen = WideCharToMultiByte(CP_UTF8, 0, warg, wlen, - NULL, 0, NULL, NULL); + NULL, 0, NULL, NULL); if (ulen <= 0) continue; } @@ -272,7 +271,7 @@ void win32_utf8argv(int *argc, char **argv[]) if (wlen > 0) WideCharToMultiByte(CP_UTF8, 0, warg, wlen, - arg, ulen, NULL, NULL); + arg, ulen, NULL, NULL); arg[ulen] = '\0'; newargv[newargc++] = arg; @@ -303,5 +302,7 @@ void win32_utf8argv(int *argc, char **argv[]) } #else void win32_utf8argv(int *argc, char **argv[]) -{ return; } +{ + return; +} #endif |
