[PATCH] getcwd(NULL,0) should allocate and return a new buffer
Nguyá»
n Thái Ngá»c Duy
pclouds at gmail.com
Wed Jul 25 18:53:15 CDT 2007
From: Nguyá»
n Thái Ngá»c Duy <pclouds at gmail.com>
The current getcwd() only allocates new buffer if size is less than
zero. If size zero is given, it returns NULL.
---
dlls/msvcrt/dir.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/msvcrt/dir.c b/dlls/msvcrt/dir.c
index 0232c4d..cd8d931 100644
--- a/dlls/msvcrt/dir.c
+++ b/dlls/msvcrt/dir.c
@@ -419,7 +419,7 @@ char* CDECL _getcwd(char * buf, int size)
if (!buf)
{
- if (size < 0)
+ if (size <= 0)
return _strdup(dir);
return msvcrt_strndup(dir,size);
}
--
1.5.2
More information about the wine-patches
mailing list