aboutsummaryrefslogtreecommitdiff
path: root/debug/getcwd_chk.c
diff options
context:
space:
mode:
Diffstat (limited to 'debug/getcwd_chk.c')
-rw-r--r--debug/getcwd_chk.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/debug/getcwd_chk.c b/debug/getcwd_chk.c
index 9e14a01..cb864c8 100644
--- a/debug/getcwd_chk.c
+++ b/debug/getcwd_chk.c
@@ -24,8 +24,8 @@
char *
__getcwd_chk (char *buf, size_t size, size_t buflen)
{
- char *res = __getcwd (buf, MIN (size, buflen));
- if (res == NULL && errno == ERANGE && size > buflen)
+ if (size > buflen)
__chk_fail ();
- return res;
+
+ return __getcwd (buf, size);
}