projects
/
kopensolaris-gnu
/
glibc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a6adcbb
)
If BUF is null, return the size of buffer required.
author
roland
<roland>
Fri, 29 Jul 1994 05:50:34 +0000
(
05:50
+0000)
committer
roland
<roland>
Fri, 29 Jul 1994 05:50:34 +0000
(
05:50
+0000)
sysdeps/mach/hurd/readlink.c
patch
|
blob
|
history
diff --git
a/sysdeps/mach/hurd/readlink.c
b/sysdeps/mach/hurd/readlink.c
index
bf7c518
..
5ce4a26
100644
(file)
--- a/
sysdeps/mach/hurd/readlink.c
+++ b/
sysdeps/mach/hurd/readlink.c
@@
-57,7
+57,12
@@
DEFUN(__readlink, (path, buf, len),
if (transp[translen - 1] == '\0')
/* Remove the null terminator. */
--len;
if (transp[translen - 1] == '\0')
/* Remove the null terminator. */
--len;
- memcpy (buf, transp + sizeof (_HURD_SYMLINK), len);
+ if (buf == NULL)
+ /* This call is just to find out how large a buffer is required. */
+ len = translen - sizeof (_HURD_SYMLINK) - 1;
+ else
+ /* Copy into the user's buffer. */
+ memcpy (buf, transp + sizeof (_HURD_SYMLINK), len);
}
if (transp != mybuf)
}
if (transp != mybuf)