GeezerVison is showing github.com — src: rename SKIP_CHECK_SIZE to SKIP_CHECK_STRLEN · nodejs/node@bd553e7
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/node_main.cc +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
28 | 28 | #include <WinError.h> |
29 | 29 |
|
30 | 30 | #define SKIP_CHECK_VAR "NODE_SKIP_PLATFORM_CHECK" |
31 | | -#define SKIP_CHECK_SIZE 1 |
32 | 31 | #define SKIP_CHECK_VALUE "1" |
| 32 | +#define SKIP_CHECK_STRLEN (sizeof(SKIP_CHECK_VALUE) - 1) |
33 | 33 |
|
34 | 34 | int wmain(int argc, wchar_t* wargv[]) { |
35 | 35 | // Windows Server 2012 (not R2) is supported until 10/10/2023, so we allow it |
36 | 36 | // to run in the experimental support tier. |
37 | | - char buf[SKIP_CHECK_SIZE + 1]; |
| 37 | + char buf[SKIP_CHECK_STRLEN + 1]; |
38 | 38 | if (!IsWindows8Point1OrGreater() && |
39 | 39 | !(IsWindowsServer() && IsWindows8OrGreater()) && |
40 | 40 | (GetEnvironmentVariableA(SKIP_CHECK_VAR, buf, sizeof(buf)) != |
41 | | - SKIP_CHECK_SIZE || |
42 | | - strncmp(buf, SKIP_CHECK_VALUE, SKIP_CHECK_SIZE + 1) != 0)) { |
| 41 | + SKIP_CHECK_STRLEN || |
| 42 | + strncmp(buf, SKIP_CHECK_VALUE, SKIP_CHECK_STRLEN) != 0)) { |
43 | 43 | fprintf(stderr, "Node.js is only supported on Windows 8.1, Windows " |
44 | 44 | "Server 2012 R2, or higher.\n" |
45 | 45 | "Setting the " SKIP_CHECK_VAR " environment variable " |
|