diff --git a/dlls/krnl386.exe16/ne_module.c b/dlls/krnl386.exe16/ne_module.c index 95dcab8e849..2fd367a220e 100644 --- a/dlls/krnl386.exe16/ne_module.c +++ b/dlls/krnl386.exe16/ne_module.c @@ -963,8 +963,8 @@ static HINSTANCE16 MODULE_LoadModule16( LPCSTR libname, BOOL implicit, BOOL lib_ NE_MODULE *pModule; const IMAGE_DOS_HEADER *descr = NULL; const char *file_name = NULL; - char dllname[32], *p; - const char *basename, *main_module; + char dllname[32]; + const char *basename, *main_module, *p; /* strip path information */ @@ -975,12 +975,14 @@ static HINSTANCE16 MODULE_LoadModule16( LPCSTR libname, BOOL implicit, BOOL lib_ if (strlen(basename) < sizeof(dllname)-6) { - strcpy( dllname, basename ); - p = strrchr( dllname, '.' ); - if (!p) strcat( dllname, ".dll" ); - for (p = dllname; *p; p++) if (*p >= 'A' && *p <= 'Z') *p += 32; + char *q; - strcpy( p, "16" ); + strcpy( dllname, basename ); + q = strrchr( dllname, '.' ); + if (!q) strcat( dllname, ".dll" ); + for (q = dllname; *q; q++) if (*q >= 'A' && *q <= 'Z') *q += 32; + + strcpy( q, "16" ); if ((mod32 = LoadLibraryA( dllname ))) { if (!(descr = (void *)GetProcAddress( mod32, "__wine_spec_dos_header" ))) diff --git a/dlls/krnl386.exe16/snoop.c b/dlls/krnl386.exe16/snoop.c index 4b8477c59b1..cef0fda7395 100644 --- a/dlls/krnl386.exe16/snoop.c +++ b/dlls/krnl386.exe16/snoop.c @@ -99,7 +99,8 @@ static HANDLE16 xsnr = 0; void SNOOP16_RegisterDLL(HMODULE16 hModule,LPCSTR name) { SNOOP16_DLL **dll = &(firstdll); - char *s; + const char *p; + char *q; if (!TRACE_ON(snoop)) return; @@ -146,11 +147,11 @@ SNOOP16_RegisterDLL(HMODULE16 hModule,LPCSTR name) { (*dll)->next = NULL; (*dll)->hmod = hModule; - if ((s=strrchr(name,'\\'))) - name = s+1; + if ((p=strrchr(name,'\\'))) + name = p+1; strcpy( (*dll)->name, name ); - if ((s=strrchr((*dll)->name,'.'))) - *s='\0'; + if ((q=strrchr((*dll)->name,'.'))) + *q='\0'; (*dll)->funhandle = GlobalHandleToSel16(GLOBAL_Alloc(GMEM_ZEROINIT,65535,0,WINE_LDT_FLAGS_CODE)); (*dll)->funs = GlobalLock16((*dll)->funhandle); if (!(*dll)->funs) {