Commit c25e7153 authored by Uwe Bonnes's avatar Uwe Bonnes Committed by Alexandre Julliard

Account for the trailing NULL in GetLogicalDriveStringsA.

parent afa8fe94
......@@ -1114,7 +1114,7 @@ UINT WINAPI GetLogicalDriveStringsA( UINT len, LPSTR buffer )
for (drive = count = 0; drive < MAX_DOS_DRIVES; drive++)
if (DRIVE_IsValid(drive)) count++;
if (count * 4 * sizeof(char) <= len)
if ((count * 4) + 1 <= len)
{
LPSTR p = buffer;
for (drive = 0; drive < MAX_DOS_DRIVES; drive++)
......@@ -1126,8 +1126,11 @@ UINT WINAPI GetLogicalDriveStringsA( UINT len, LPSTR buffer )
*p++ = '\0';
}
*p = '\0';
return count * 4;
}
return count * 4 * sizeof(char);
else
return (count * 4) + 1;/* account for terminating null */
/* The API tells about these different return values */
}
......
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