Commit ebf4ae03 authored by Frédéric Delanoy's avatar Frédéric Delanoy Committed by Alexandre Julliard

krnl386.exe16: Avoid hardcoding array lengths.

parent 954e6eba
...@@ -336,7 +336,7 @@ static BYTE INT21_MapDrive( BYTE drive ) ...@@ -336,7 +336,7 @@ static BYTE INT21_MapDrive( BYTE drive )
{ {
if (drive) if (drive)
{ {
WCHAR drivespec[3] = {'A', ':', 0}; WCHAR drivespec[] = {'A', ':', 0};
UINT drivetype; UINT drivetype;
drivespec[0] += drive - 1; drivespec[0] += drive - 1;
...@@ -359,7 +359,7 @@ static BYTE INT21_MapDrive( BYTE drive ) ...@@ -359,7 +359,7 @@ static BYTE INT21_MapDrive( BYTE drive )
*/ */
static void INT21_SetCurrentDrive( BYTE drive ) static void INT21_SetCurrentDrive( BYTE drive )
{ {
WCHAR drivespec[3] = {'A', ':', 0}; WCHAR drivespec[] = {'A', ':', 0};
drivespec[0] += drive; drivespec[0] += drive;
...@@ -2451,7 +2451,7 @@ static void INT21_Ioctl_Block( CONTEXT *context ) ...@@ -2451,7 +2451,7 @@ static void INT21_Ioctl_Block( CONTEXT *context )
{ {
BYTE *dataptr; BYTE *dataptr;
BYTE drive = INT21_MapDrive( BL_reg(context) ); BYTE drive = INT21_MapDrive( BL_reg(context) );
WCHAR drivespec[4] = {'A', ':', '\\', 0}; WCHAR drivespec[] = {'A', ':', '\\', 0};
UINT drivetype; UINT drivetype;
drivespec[0] += drive; drivespec[0] += drive;
......
...@@ -82,7 +82,7 @@ BOOL DOSVM_RawRead(BYTE drive, DWORD begin, DWORD nr_sect, BYTE *dataptr, BOOL f ...@@ -82,7 +82,7 @@ BOOL DOSVM_RawRead(BYTE drive, DWORD begin, DWORD nr_sect, BYTE *dataptr, BOOL f
*/ */
void WINAPI DOSVM_Int25Handler( CONTEXT *context ) 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 ); BYTE *dataptr = CTX_SEG_OFF_TO_LIN( context, context->SegDs, context->Ebx );
DWORD begin; DWORD begin;
DWORD length; DWORD length;
......
...@@ -71,7 +71,7 @@ BOOL DOSVM_RawWrite(BYTE drive, DWORD begin, DWORD nr_sect, BYTE *dataptr, BOOL ...@@ -71,7 +71,7 @@ BOOL DOSVM_RawWrite(BYTE drive, DWORD begin, DWORD nr_sect, BYTE *dataptr, BOOL
*/ */
void WINAPI DOSVM_Int26Handler( CONTEXT *context ) 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 ); BYTE *dataptr = CTX_SEG_OFF_TO_LIN( context, context->SegDs, context->Ebx );
DWORD begin; DWORD begin;
DWORD length; DWORD length;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment