aboutsummaryrefslogtreecommitdiff
path: root/nss/nss_files/files-alias.c
diff options
context:
space:
mode:
authorQihao Chencao <twose@qq.com>2022-06-28 16:57:55 +0800
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-02-17 17:07:44 -0300
commitcc4d6614b5922c1104125b1f4d0850a88a551882 (patch)
treeaade315fd79153cf930e8dfd15581dcbdffea0b8 /nss/nss_files/files-alias.c
parentdab63442791e334d592ce91827ffa9d14ca92ea9 (diff)
downloadglibc-cc4d6614b5922c1104125b1f4d0850a88a551882.tar
glibc-cc4d6614b5922c1104125b1f4d0850a88a551882.tar.gz
glibc-cc4d6614b5922c1104125b1f4d0850a88a551882.tar.bz2
glibc-cc4d6614b5922c1104125b1f4d0850a88a551882.zip
Use uintptr_t instead of performing pointer subtraction with a null pointer
Signed-off-by: Qihao Chencao <twose@qq.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'nss/nss_files/files-alias.c')
-rw-r--r--nss/nss_files/files-alias.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nss/nss_files/files-alias.c b/nss/nss_files/files-alias.c
index 1c32884fe7..4601cb6ce9 100644
--- a/nss/nss_files/files-alias.c
+++ b/nss/nss_files/files-alias.c
@@ -281,7 +281,7 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
/* Adjust the pointer so it is aligned for
storing pointers. */
first_unused += __alignof__ (char *) - 1;
- first_unused -= ((first_unused - (char *) 0)
+ first_unused -= (((uintptr_t) first_unused)
% __alignof__ (char *));
result->alias_members = (char **) first_unused;