Commit a03f0641 authored by Huw D M Davies's avatar Huw D M Davies Committed by Alexandre Julliard

Fix GetTempPath32 if count=0.

parent ecc7669d
...@@ -138,7 +138,7 @@ UINT32 WINAPI GetTempPath32A( UINT32 count, LPSTR path ) ...@@ -138,7 +138,7 @@ UINT32 WINAPI GetTempPath32A( UINT32 count, LPSTR path )
if (!(ret = GetEnvironmentVariable32A( "TEMP", path, count ))) if (!(ret = GetEnvironmentVariable32A( "TEMP", path, count )))
if (!(ret = GetCurrentDirectory32A( count, path ))) if (!(ret = GetCurrentDirectory32A( count, path )))
return 0; return 0;
if ((ret < count - 1) && (path[ret-1] != '\\')) if (count && (ret < count - 1) && (path[ret-1] != '\\'))
{ {
path[ret++] = '\\'; path[ret++] = '\\';
path[ret] = '\0'; path[ret] = '\0';
...@@ -159,7 +159,7 @@ UINT32 WINAPI GetTempPath32W( UINT32 count, LPWSTR path ) ...@@ -159,7 +159,7 @@ UINT32 WINAPI GetTempPath32W( UINT32 count, LPWSTR path )
if (!(ret = GetEnvironmentVariable32W( temp, path, count ))) if (!(ret = GetEnvironmentVariable32W( temp, path, count )))
if (!(ret = GetCurrentDirectory32W( count, path ))) if (!(ret = GetCurrentDirectory32W( count, path )))
return 0; return 0;
if ((ret < count - 1) && (path[ret-1] != '\\')) if (count && (ret < count - 1) && (path[ret-1] != '\\'))
{ {
path[ret++] = '\\'; path[ret++] = '\\';
path[ret] = '\0'; path[ret] = '\0';
......
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