Win32OperatingSystem.st
changeset 25139 ee3a1332f546
parent 25138 cabf976a45b9
child 25184 5b1c5f143284
--- a/Win32OperatingSystem.st	Mon Dec 16 18:39:46 2019 +0100
+++ b/Win32OperatingSystem.st	Mon Dec 16 18:42:21 2019 +0100
@@ -4144,9 +4144,10 @@
      * so take a good average for its arguments 4096
      * ATTENTION this value is also used hardcoded in the following code to check the length
      */
-    wchar_t cmdPathW[4096];
-    wchar_t cmdLineW[4096];
-    wchar_t dirNameW[4096];
+    #define MAX_WPATH 4096
+    wchar_t cmdPathW[MAX_WPATH];
+    wchar_t cmdLineW[MAX_WPATH];
+    wchar_t dirNameW[MAX_WPATH];
 
     /*
      * pass pointers to CreateProcess
@@ -4178,7 +4179,7 @@
         // #commandPathUni16
         if (commandPathUni16 != nil) {
             l = __unicode16StringSize(commandPathUni16);
-            if (l >= 4096) { // >= need 1 space for terminator
+            if (l >= MAX_WPATH) { // >= need 1 space for terminator
 # ifdef PROCESSDEBUGWIN32
                 if (flag_PROCESSDEBUGWIN32) {
                     console_fprintf(stderr, "argument #commandPathUni16 is to long\n");
@@ -4195,7 +4196,7 @@
 
         // commandLineUni16
         l = __unicode16StringSize(commandLineUni16);
-        if (l >= 4096) { // >= need 1 space for terminator
+        if (l >= MAX_WPATH) { // >= need 1 space for terminator
 # ifdef PROCESSDEBUGWIN32
             if (flag_PROCESSDEBUGWIN32) {
                 console_fprintf(stderr, "argument #commandLineUni16 is to long\n");
@@ -4212,7 +4213,7 @@
         // #dirNameUni16
         if (__isUnicode16String(dirNameUni16)) {
             l = __unicode16StringSize(dirNameUni16);
-            if (l >= 4096) { // >= need 1 space for terminator
+            if (l >= MAX_WPATH) { // >= need 1 space for terminator
 # ifdef PROCESSDEBUGWIN32
                 if (flag_PROCESSDEBUGWIN32) {
                     console_fprintf(stderr, "argument #dirNameUni16 is to long\n");