about summary refs log tree commit diff
path: root/string/strcspn.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2016-04-01 18:33:03 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2016-04-01 18:33:03 -0300
commit2e51bc3813ca3fe72fd197d08d79496e46669f43 (patch)
tree568b95b4c3761cd712b6d16092998335852a2606 /string/strcspn.c
parent344303f3cfc072469c7c32de90952871c108afd5 (diff)
downloadglibc-2e51bc3813ca3fe72fd197d08d79496e46669f43.tar.gz
glibc-2e51bc3813ca3fe72fd197d08d79496e46669f43.tar.xz
glibc-2e51bc3813ca3fe72fd197d08d79496e46669f43.zip
Use PTR_ALIGN_DOWN on strcspn and strspn
Tested on aarch64.

	* string/strcspn.c (strcspn): Use PTR_ALIGN_DOWN.
	* string/strspn.c (strspn): Likewise.
Diffstat (limited to 'string/strcspn.c')
-rw-r--r--string/strcspn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/string/strcspn.c b/string/strcspn.c
index c535dd1c3d..0e01193bc5 100644
--- a/string/strcspn.c
+++ b/string/strcspn.c
@@ -17,6 +17,7 @@
 
 #include <string.h>
 #include <stdint.h>
+#include <libc-internal.h>
 
 #undef strcspn
 
@@ -52,7 +53,7 @@ STRCSPN (const char *str, const char *reject)
   if (p[s[2]]) return 2;
   if (p[s[3]]) return 3;
 
-  s = (unsigned char *) ((uintptr_t)(s) & ~3);
+  s = (unsigned char *) PTR_ALIGN_DOWN (s, 4);
 
   unsigned int c0, c1, c2, c3;
   do