shell32: Avoid hardcoding array lengths.

This commit is contained in:
Frédéric Delanoy 2011-11-22 23:00:39 +01:00 committed by Alexandre Julliard
parent c55db752a2
commit 40179bedee
2 changed files with 2 additions and 2 deletions

View File

@ -2115,7 +2115,7 @@ static HRESULT ShellLink_SetAdvertiseInfo(IShellLinkImpl *This, LPCWSTR str)
static BOOL ShellLink_GetVolumeInfo(LPCWSTR path, volume_info *volume) static BOOL ShellLink_GetVolumeInfo(LPCWSTR path, volume_info *volume)
{ {
const int label_sz = sizeof volume->label/sizeof volume->label[0]; const int label_sz = sizeof volume->label/sizeof volume->label[0];
WCHAR drive[4] = { path[0], ':', '\\', 0 }; WCHAR drive[] = { path[0], ':', '\\', 0 };
BOOL r; BOOL r;
volume->type = GetDriveTypeW(drive); volume->type = GetDriveTypeW(drive);

View File

@ -1609,7 +1609,7 @@ static HRESULT WINAPI UnixFolder_IPersistFolder3_Initialize(IPersistFolder3* ifa
if (current->mkid.cb) { if (current->mkid.cb) {
if (_ILIsDrive(current)) { if (_ILIsDrive(current)) {
WCHAR wszDrive[4] = { '?', ':', '\\', 0 }; WCHAR wszDrive[] = { '?', ':', '\\', 0 };
wszDrive[0] = (WCHAR)*_ILGetTextPointer(current); wszDrive[0] = (WCHAR)*_ILGetTextPointer(current);
if (!UNIXFS_get_unix_path(wszDrive, szBasePath)) if (!UNIXFS_get_unix_path(wszDrive, szBasePath))
return E_FAIL; return E_FAIL;