aboutsummaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
Diffstat (limited to 'posix')
-rw-r--r--posix/glob.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/posix/glob.c b/posix/glob.c
index 511ec4b..8557196 100644
--- a/posix/glob.c
+++ b/posix/glob.c
@@ -641,7 +641,8 @@ __glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
{
# if defined HAVE_GETPWNAM_R || defined _LIBC
size_t ssize = strlen (s.data) + 1;
- err = getpwnam_r (s.data, &pwbuf, s.data + ssize,
+ char *sdata = s.data;
+ err = getpwnam_r (sdata, &pwbuf, sdata + ssize,
s.length - ssize, &p);
# else
p = getpwnam (s.data);