]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - string/strcspn.c
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / string / strcspn.c
index c535dd1c3dd0363111018f14aa0b74b0c9b0ab13..e9fb8c5cb2fc6892e1b4c91055ca06056caa2bfb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
 
 #include <string.h>
 #include <stdint.h>
+#include <libc-pointer-arith.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