https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8a2cc3cddab22b10f82387764426acd47412ac3e

commit 8a2cc3cddab22b10f82387764426acd47412ac3e
Author:     Eric Kohl <[email protected]>
AuthorDate: Sat May 19 12:09:12 2018 +0200
Commit:     Eric Kohl <[email protected]>
CommitDate: Sat May 19 12:09:58 2018 +0200

    [USETUP] Improved entering of partition size
    
    Patch by Эдуард.
    
    CORE-13249
---
 base/setup/usetup/usetup.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/base/setup/usetup/usetup.c b/base/setup/usetup/usetup.c
index 71dc354ae0..b702815cae 100644
--- a/base/setup/usetup/usetup.c
+++ b/base/setup/usetup/usetup.c
@@ -27,6 +27,7 @@
  */
 
 #include <usetup.h>
+#include <math.h>
 
 #include "bootsup.h"
 #include "chkdsk.h"
@@ -1755,9 +1756,9 @@ SelectPartitionPage(PINPUT_RECORD Ir)
 }
 
 
-#define PARTITION_SIZE_INPUT_FIELD_LENGTH 6
-/* Restriction for MaxSize: pow(10, PARTITION_SIZE_INPUT_FIELD_LENGTH)-1 */
-#define PARTITION_MAXSIZE 999999
+#define PARTITION_SIZE_INPUT_FIELD_LENGTH 9
+/* Restriction for MaxSize: pow(10, (PARTITION_SIZE_INPUT_FIELD_LENGTH - 1)) - 
1 */
+#define PARTITION_MAXSIZE (pow(10, (PARTITION_SIZE_INPUT_FIELD_LENGTH - 1)) - 
1)
 
 static VOID
 ShowPartitionSizeInputBox(SHORT Left,
@@ -1916,7 +1917,7 @@ ShowPartitionSizeInputBox(SHORT Left,
         }
         else if (Ir.Event.KeyEvent.uChar.AsciiChar != 0x00)
         {
-            if (Length < PARTITION_SIZE_INPUT_FIELD_LENGTH)
+            if (Length < PARTITION_SIZE_INPUT_FIELD_LENGTH - 1)
             {
                 ch = (WCHAR)Ir.Event.KeyEvent.uChar.AsciiChar;
 

Reply via email to