about summary refs log tree commit diff
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 9e14a0102e..cb864c858e 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);
 }