mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
src: rename SKIP_CHECK_SIZE to SKIP_CHECK_STRLEN
SKIP_CHECK_VALUE is a string literal, so its size is the length of the string in chars plus one. The buffer buf is also always null-terminated, so its size should match the size of SKIP_CHECK_VALUE, which is _not_ SKIP_CHECK_SIZE. Rename SKIP_CHECK_SIZE to be consistent with C/C++ terminology. PR-URL: https://github.com/nodejs/node/pull/47845 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
1 parent
38d261ae66
commit
19afcba9d4
1 file changed
+4
-4
+4
-4
@@ -28,18 +28,18 @@
|
||||
#include <WinError.h>
|
||||
|
||||
#define SKIP_CHECK_VAR "NODE_SKIP_PLATFORM_CHECK"
|
||||
#define SKIP_CHECK_SIZE 1
|
||||
#define SKIP_CHECK_VALUE "1"
|
||||
#define SKIP_CHECK_STRLEN (sizeof(SKIP_CHECK_VALUE) - 1)
|
||||
|
||||
int wmain(int argc, wchar_t* wargv[]) {
|
||||
// Windows Server 2012 (not R2) is supported until 10/10/2023, so we allow it
|
||||
// to run in the experimental support tier.
|
||||
char buf[SKIP_CHECK_SIZE + 1];
|
||||
char buf[SKIP_CHECK_STRLEN + 1];
|
||||
if (!IsWindows8Point1OrGreater() &&
|
||||
!(IsWindowsServer() && IsWindows8OrGreater()) &&
|
||||
(GetEnvironmentVariableA(SKIP_CHECK_VAR, buf, sizeof(buf)) !=
|
||||
SKIP_CHECK_SIZE ||
|
||||
strncmp(buf, SKIP_CHECK_VALUE, SKIP_CHECK_SIZE + 1) != 0)) {
|
||||
SKIP_CHECK_STRLEN ||
|
||||
strncmp(buf, SKIP_CHECK_VALUE, SKIP_CHECK_STRLEN) != 0)) {
|
||||
fprintf(stderr, "Node.js is only supported on Windows 8.1, Windows "
|
||||
"Server 2012 R2, or higher.\n"
|
||||
"Setting the " SKIP_CHECK_VAR " environment variable "
|
||||
|
||||
Reference in new issue
Block a user