fixup procexe.name on non-english windows

This commit is contained in:
Doug MacEachern 2007-03-06 03:39:29 +00:00
parent 955891dbef
commit d459b79bdd
1 changed files with 5 additions and 0 deletions

View File

@ -98,6 +98,11 @@ int sigar_proc_exe_peb_get(sigar_t *sigar, HANDLE proc,
PEB_NEXT(scratch); //skip PATH
/* XXX seen on non-english windows, random leading char */
if (*(scratch + sizeof(WCHAR)) != L':') {
scratch += sizeof(WCHAR);
}
wcsncpy(buf, (LPWSTR)scratch, MAX_PATH);
buf[MAX_PATH-1] = L'\0';