This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[COMMITTED] glob: Silence warning about void pointer arithmetic
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-alpha at sourceware dot org
- Date: Tue, 19 Dec 2017 16:03:59 -0200
- Subject: [COMMITTED] glob: Silence warning about void pointer arithmetic
- Authentication-results: sourceware.org; auth=none
- References: <1513706639-12259-1-git-send-email-adhemerval.zanella@linaro.org>
Sync with gnulib 0e14f025d2.
Checked on x86_64-linux-gnu.
* lib/glob.c (glob): Use a 'char *', not a 'void *', in pointer
arithmetic.
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
---
ChangeLog | 3 +++
posix/glob.c | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)
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);
--
2.7.4