krnl386.exe16: Avoid harcoding array lengths

Frédéric Delanoy frederic.delanoy at gmail.com
Mon Nov 21 12:19:48 CST 2011


---
 dlls/krnl386.exe16/int21.c |    6 +++---
 dlls/krnl386.exe16/int25.c |    2 +-
 dlls/krnl386.exe16/int26.c |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/dlls/krnl386.exe16/int21.c b/dlls/krnl386.exe16/int21.c
index 2ec6345..f8e235a 100644
--- a/dlls/krnl386.exe16/int21.c
+++ b/dlls/krnl386.exe16/int21.c
@@ -336,7 +336,7 @@ static BYTE INT21_MapDrive( BYTE drive )
 {
     if (drive)
     {
-        WCHAR drivespec[3] = {'A', ':', 0};
+        WCHAR drivespec[] = {'A', ':', 0};
         UINT  drivetype;
 
         drivespec[0] += drive - 1;
@@ -359,7 +359,7 @@ static BYTE INT21_MapDrive( BYTE drive )
  */
 static void INT21_SetCurrentDrive( BYTE drive )
 {
-    WCHAR drivespec[3] = {'A', ':', 0};
+    WCHAR drivespec[] = {'A', ':', 0};
 
     drivespec[0] += drive;
 
@@ -2451,7 +2451,7 @@ static void INT21_Ioctl_Block( CONTEXT *context )
 {
     BYTE *dataptr;
     BYTE  drive = INT21_MapDrive( BL_reg(context) );
-    WCHAR drivespec[4] = {'A', ':', '\\', 0};
+    WCHAR drivespec[] = {'A', ':', '\\', 0};
     UINT  drivetype;
 
     drivespec[0] += drive;
diff --git a/dlls/krnl386.exe16/int25.c b/dlls/krnl386.exe16/int25.c
index 5aa0b55..0513c8f 100644
--- a/dlls/krnl386.exe16/int25.c
+++ b/dlls/krnl386.exe16/int25.c
@@ -82,7 +82,7 @@ BOOL DOSVM_RawRead(BYTE drive, DWORD begin, DWORD nr_sect, BYTE *dataptr, BOOL f
  */
 void WINAPI DOSVM_Int25Handler( CONTEXT *context )
 {
-    WCHAR drivespec[4] = {'A', ':', '\\', 0};
+    WCHAR drivespec[] = {'A', ':', '\\', 0};
     BYTE *dataptr = CTX_SEG_OFF_TO_LIN( context, context->SegDs, context->Ebx );
     DWORD begin;
     DWORD length;
diff --git a/dlls/krnl386.exe16/int26.c b/dlls/krnl386.exe16/int26.c
index e475c8d..bb3d90b 100644
--- a/dlls/krnl386.exe16/int26.c
+++ b/dlls/krnl386.exe16/int26.c
@@ -71,7 +71,7 @@ BOOL DOSVM_RawWrite(BYTE drive, DWORD begin, DWORD nr_sect, BYTE *dataptr, BOOL
  */
 void WINAPI DOSVM_Int26Handler( CONTEXT *context )
 {
-    WCHAR drivespec[4] = {'A', ':', '\\', 0};
+    WCHAR drivespec[] = {'A', ':', '\\', 0};
     BYTE *dataptr = CTX_SEG_OFF_TO_LIN( context, context->SegDs, context->Ebx );
     DWORD begin;
     DWORD length;
-- 
1.7.7.2




More information about the wine-patches mailing list