diff options
| author | Guillaume Chatelet <gchatelet@google.com> | 2023-09-26 11:45:04 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-26 11:45:04 +0200 |
| commit | b6bc9d72f65a5086f310f321e969d96e9a559e75 (patch) | |
| tree | 1e9a9f8c36c9dfc0106507f7b7a0055af83c4a07 /libc/fuzzing/string | |
| parent | 7675f541f75baa20e8ec007cd625a837e89fc01f (diff) | |
[libc] Mass replace enclosing namespace (#67032)
This is step 4 of
https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079
Diffstat (limited to 'libc/fuzzing/string')
| -rw-r--r-- | libc/fuzzing/string/strcmp_fuzz.cpp | 4 | ||||
| -rw-r--r-- | libc/fuzzing/string/strcpy_fuzz.cpp | 2 | ||||
| -rw-r--r-- | libc/fuzzing/string/strstr_fuzz.cpp | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/libc/fuzzing/string/strcmp_fuzz.cpp b/libc/fuzzing/string/strcmp_fuzz.cpp index c1b497dfb206..50587bf3778b 100644 --- a/libc/fuzzing/string/strcmp_fuzz.cpp +++ b/libc/fuzzing/string/strcmp_fuzz.cpp @@ -64,12 +64,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { // The expected result should be the difference between the first non-equal // characters of s1 and s2. If all characters are equal, the expected result // should be '\0' - '\0' = 0. - if (__llvm_libc::strcmp(s1, s2) != ch1 - ch2) + if (LIBC_NAMESPACE::strcmp(s1, s2) != ch1 - ch2) __builtin_trap(); // Verify reversed operands. This should be the negated value of the previous // result, except of course if the previous result was zero. - if (__llvm_libc::strcmp(s2, s1) != ch2 - ch1) + if (LIBC_NAMESPACE::strcmp(s2, s1) != ch2 - ch1) __builtin_trap(); delete[] data1; diff --git a/libc/fuzzing/string/strcpy_fuzz.cpp b/libc/fuzzing/string/strcpy_fuzz.cpp index 10e0c03bb18f..c15649aa07ec 100644 --- a/libc/fuzzing/string/strcpy_fuzz.cpp +++ b/libc/fuzzing/string/strcpy_fuzz.cpp @@ -21,7 +21,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { char *dest = new char[size]; if (!dest) __builtin_trap(); - __llvm_libc::strcpy(dest, src); + LIBC_NAMESPACE::strcpy(dest, src); size_t i; for (i = 0; src[i] != '\0'; i++) { diff --git a/libc/fuzzing/string/strstr_fuzz.cpp b/libc/fuzzing/string/strstr_fuzz.cpp index 5ccf85c7dc0f..34ee89148907 100644 --- a/libc/fuzzing/string/strstr_fuzz.cpp +++ b/libc/fuzzing/string/strstr_fuzz.cpp @@ -54,11 +54,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { const char *needle = reinterpret_cast<const char *>(container); const char *haystack = reinterpret_cast<const char *>(data + i); - const char *result = __llvm_libc::strstr(haystack, needle); + const char *result = LIBC_NAMESPACE::strstr(haystack, needle); // A null terminator may exist earlier in each, so this needs to be recorded. - const size_t haystack_size = __llvm_libc::strlen(haystack); - const size_t needle_size = __llvm_libc::strlen(needle); + const size_t haystack_size = LIBC_NAMESPACE::strlen(haystack); + const size_t needle_size = LIBC_NAMESPACE::strlen(needle); if (result) { // The needle is in the haystack. |
