fortify: s/([gl])eq/\1e/g
Follow-up from review comments in
https://android-review.googlesource.com/c/platform/bionic/+/961600
Bug: 131861088
Test: mma
Change-Id: Ic2d48c935ced3c7e875923810f4e9970e7439e51
diff --git a/libc/include/bits/fortify/string.h b/libc/include/bits/fortify/string.h
index af93b91..1e12986 100644
--- a/libc/include/bits/fortify/string.h
+++ b/libc/include/bits/fortify/string.h
@@ -70,10 +70,10 @@
__BIONIC_FORTIFY_INLINE
char* stpcpy(char* const dst __pass_object_size, const char* src)
__overloadable
- __clang_error_if(__bos_unevaluated_leq(__bos(dst), __builtin_strlen(src)),
+ __clang_error_if(__bos_unevaluated_le(__bos(dst), __builtin_strlen(src)),
"'stpcpy' called with string bigger than buffer") {
size_t bos_dst = __bos(dst);
- if (__bos_trivially_not_leq(bos_dst, __builtin_strlen(src))) {
+ if (__bos_trivially_not_le(bos_dst, __builtin_strlen(src))) {
return __builtin_stpcpy(dst, src);
}
return __builtin___stpcpy_chk(dst, src, bos_dst);
@@ -84,10 +84,10 @@
__BIONIC_FORTIFY_INLINE
char* strcpy(char* const dst __pass_object_size, const char* src)
__overloadable
- __clang_error_if(__bos_unevaluated_leq(__bos(dst), __builtin_strlen(src)),
+ __clang_error_if(__bos_unevaluated_le(__bos(dst), __builtin_strlen(src)),
"'strcpy' called with string bigger than buffer") {
size_t bos_dst = __bos(dst);
- if (__bos_trivially_not_leq(bos_dst, __builtin_strlen(src))) {
+ if (__bos_trivially_not_le(bos_dst, __builtin_strlen(src))) {
return __builtin_strcpy(dst, src);
}
return __builtin___strcpy_chk(dst, src, bos_dst);
@@ -123,7 +123,7 @@
void* memchr(const void* const s __pass_object_size, int c, size_t n) __overloadable {
size_t bos = __bos(s);
- if (__bos_trivially_geq(bos, n)) {
+ if (__bos_trivially_ge(bos, n)) {
return __builtin_memchr(s, c, n);
}
@@ -134,7 +134,7 @@
void* __memrchr_fortify(const void* const __pass_object_size s, int c, size_t n) __overloadable {
size_t bos = __bos(s);
- if (__bos_trivially_geq(bos, n)) {
+ if (__bos_trivially_ge(bos, n)) {
return __memrchr_real(s, c, n);
}
diff --git a/libc/include/sys/cdefs.h b/libc/include/sys/cdefs.h
index 42bf451..dceb116 100644
--- a/libc/include/sys/cdefs.h
+++ b/libc/include/sys/cdefs.h
@@ -293,7 +293,7 @@
#define __bos_unevaluated_lt(bos_val, val) \
((bos_val) != __BIONIC_FORTIFY_UNKNOWN_SIZE && (bos_val) < (val))
-#define __bos_unevaluated_leq(bos_val, val) \
+#define __bos_unevaluated_le(bos_val, val) \
((bos_val) != __BIONIC_FORTIFY_UNKNOWN_SIZE && (bos_val) <= (val))
/* Intended for use in evaluated contexts. */
@@ -304,13 +304,13 @@
#define __bos_dynamic_check_impl(bos_val, op, index) \
__bos_dynamic_check_impl_and(bos_val, op, index, 1)
-#define __bos_trivially_geq(bos_val, index) __bos_dynamic_check_impl((bos_val), >=, (index))
+#define __bos_trivially_ge(bos_val, index) __bos_dynamic_check_impl((bos_val), >=, (index))
#define __bos_trivially_gt(bos_val, index) __bos_dynamic_check_impl((bos_val), >, (index))
/* The names here are meant to match nicely with the __bos_unevaluated macros above. */
-#define __bos_trivially_not_lt __bos_trivially_geq
-#define __bos_trivially_not_leq __bos_trivially_gt
+#define __bos_trivially_not_lt __bos_trivially_ge
+#define __bos_trivially_not_le __bos_trivially_gt
#if defined(__BIONIC_FORTIFY) || defined(__BIONIC_DECLARE_FORTIFY_HELPERS)