diff options
-rw-r--r-- | ChangeLog.txt | 3 | ||||
-rw-r--r-- | guts/getcwd.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index 42424cd..534041e 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,6 @@ +2010-09-02: + * (seebs) fix errno for getcwd() with insufficient size + 2010-09-01: * (seebs) add missing casts to even more printf arguments diff --git a/guts/getcwd.c b/guts/getcwd.c index 2537e94..b3f552c 100644 --- a/guts/getcwd.c +++ b/guts/getcwd.c @@ -44,12 +44,12 @@ } } if (pseudo_cwd_len - (pseudo_cwd_rel - pseudo_cwd) >= size) { - pseudo_diag("only %ld bytes available, need %ld (%ld + 1 - %ld)\n", + pseudo_debug(1, "only %ld bytes available, need %ld (%ld + 1 - %ld)\n", (unsigned long) size, (unsigned long) pseudo_cwd_len + 1 - pseudo_chroot_len, (unsigned long) pseudo_cwd_len, (unsigned long) pseudo_chroot_len); - errno = ENAMETOOLONG; + errno = ERANGE; return NULL; } rc = buf; |