windows.cfg: Fixed FP for invalidFunctionArg in second argument of _getcwd(). Reference: https://docs.microsoft.com/en-us/previous-versions/sf98bd4y(v%3Dvs.140)
This commit is contained in:
parent
b6faa11fbf
commit
9bfe7d74c0
|
@ -1846,7 +1846,8 @@
|
||||||
</arg>
|
</arg>
|
||||||
<arg nr="2" direction="in">
|
<arg nr="2" direction="in">
|
||||||
<not-uninit/>
|
<not-uninit/>
|
||||||
<valid>1:</valid>
|
<!-- Zero length is allowed in case the first argument is NULL. -->
|
||||||
|
<valid>0:</valid>
|
||||||
<not-bool/>
|
<not-bool/>
|
||||||
</arg>
|
</arg>
|
||||||
</function>
|
</function>
|
||||||
|
|
|
@ -8,6 +8,19 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <direct.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
void invalidFunctionArg__getcwd(char * buffer)
|
||||||
|
{
|
||||||
|
// Passing NULL as the buffer forces getcwd to allocate
|
||||||
|
// memory for the path, which allows the code to support file paths
|
||||||
|
// longer than _MAX_PATH, which are supported by NTFS.
|
||||||
|
if ((buffer = _getcwd(NULL, 0)) == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
free(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
void validCode()
|
void validCode()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue