dso/dso_win32.c: fix compiler warning.
This commit is contained in:
parent
fb0a520897
commit
0a2d5003df
@ -689,7 +689,6 @@ static int win32_pathbyaddr(void *addr,char *path,int sz)
|
|||||||
CREATETOOLHELP32SNAPSHOT create_snap;
|
CREATETOOLHELP32SNAPSHOT create_snap;
|
||||||
CLOSETOOLHELP32SNAPSHOT close_snap;
|
CLOSETOOLHELP32SNAPSHOT close_snap;
|
||||||
MODULE32 module_first, module_next;
|
MODULE32 module_first, module_next;
|
||||||
int len;
|
|
||||||
|
|
||||||
if (addr == NULL)
|
if (addr == NULL)
|
||||||
{
|
{
|
||||||
@ -752,21 +751,25 @@ static int win32_pathbyaddr(void *addr,char *path,int sz)
|
|||||||
return WideCharToMultiByte(CP_ACP,0,me32.szExePath,-1,
|
return WideCharToMultiByte(CP_ACP,0,me32.szExePath,-1,
|
||||||
path,sz,NULL,NULL);
|
path,sz,NULL,NULL);
|
||||||
# else
|
# else
|
||||||
len = (int)wcslen(me32.szExePath);
|
{
|
||||||
|
int i,len = (int)wcslen(me32.szExePath);
|
||||||
if (sz <= 0) return len+1;
|
if (sz <= 0) return len+1;
|
||||||
if (len >= sz) len=sz-1;
|
if (len >= sz) len=sz-1;
|
||||||
for(i=0;i<len;i++)
|
for(i=0;i<len;i++)
|
||||||
path[i] = (char)me32.szExePath[i];
|
path[i] = (char)me32.szExePath[i];
|
||||||
path[len++] = 0;
|
path[len++] = 0;
|
||||||
return len;
|
return len;
|
||||||
|
}
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
len = (int)strlen(me32.szExePath);
|
{
|
||||||
|
int len = (int)strlen(me32.szExePath);
|
||||||
if (sz <= 0) return len+1;
|
if (sz <= 0) return len+1;
|
||||||
if (len >= sz) len=sz-1;
|
if (len >= sz) len=sz-1;
|
||||||
memcpy(path,me32.szExePath,len);
|
memcpy(path,me32.szExePath,len);
|
||||||
path[len++] = 0;
|
path[len++] = 0;
|
||||||
return len;
|
return len;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} while((*module_next)(hModuleSnap, &me32));
|
} while((*module_next)(hModuleSnap, &me32));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user