Index: sysdeps/nacl/sysdep.h |
diff --git a/sysdeps/nacl/sysdep.h b/sysdeps/nacl/sysdep.h |
index 2e2b8b09bd908bccc50e9d42a2845249896d1a2c..49fa28d22c13caa5ebaf7d6cd57522112acb14ef 100644 |
--- a/sysdeps/nacl/sysdep.h |
+++ b/sysdeps/nacl/sysdep.h |
@@ -5,6 +5,7 @@ |
#include <futex_emulation.h> |
#include <irt_syscalls.h> |
#include <lowlevellock.h> |
+#include <string.h> |
/* Implementation of all syscalls for use in platform- and OS- independent code |
as inline functions. Each function translates the syscall arguments into IRT |
@@ -598,8 +599,7 @@ INTERNAL_SYSCALL_getcwd_2 (int *err, char *buf, size_t size) |
if (*err) { |
return 0; |
} |
- for (len = 0; len < size && buf[len] != '\0'; ++len); |
- return len; |
+ return __strnlen(buf, size - 1) + 1; |
} |
__extern_always_inline gid_t |