/external/curl/tests/unit/ |
D | unit1603.c | 63 if(Curl_hash_str(key1, strlen(key1), slots) != 1 || 64 Curl_hash_str(key2, strlen(key2), slots) != 0 || 65 Curl_hash_str(key3, strlen(key3), slots) != 2 || 66 Curl_hash_str(key4, strlen(key4), slots) != 1) 70 nodep = Curl_hash_add(&hash_static, &key1, strlen(key1), &key1); 72 nodep = Curl_hash_pick(&hash_static, &key1, strlen(key1)); 75 nodep = Curl_hash_add(&hash_static, &key2, strlen(key2), &key2); 77 nodep = Curl_hash_pick(&hash_static, &key2, strlen(key2)); 80 nodep = Curl_hash_add(&hash_static, &key3, strlen(key3), &key3); 82 nodep = Curl_hash_pick(&hash_static, &key3, strlen(key3)); [all …]
|
/external/llvm-project/clang/test/Analysis/ |
D | string.c | 79 #define strlen BUILTIN(strlen) macro 80 size_t strlen(const char *s); 83 clang_analyzer_eval(strlen("123") == 3); // expected-warning{{TRUE}} in strlen_constant0() 88 clang_analyzer_eval(strlen(a) == 3); // expected-warning{{TRUE}} in strlen_constant1() 93 clang_analyzer_eval(strlen(a) == 3); // expected-warning{{TRUE}} in strlen_constant2() 96 clang_analyzer_eval(strlen(a) == 3); // expected-warning{{UNKNOWN}} in strlen_constant2() 100 …return strlen(0); // expected-warning{{Null pointer passed as 1st argument to string length functi… in strlen_null() 104 …return strlen((char*)&strlen_fn); // expected-warning{{Argument to string length function is the a… in strlen_fn() 109 …return strlen((char*)&&label); // expected-warning{{Argument to string length function is the addr… in strlen_nonloc() 119 size_t a = strlen(z.a); in strlen_subregion() [all …]
|
/external/clang/test/Analysis/ |
D | string.c | 38 #define strlen BUILTIN(strlen) macro 39 size_t strlen(const char *s); 42 clang_analyzer_eval(strlen("123") == 3); // expected-warning{{TRUE}} in strlen_constant0() 47 clang_analyzer_eval(strlen(a) == 3); // expected-warning{{TRUE}} in strlen_constant1() 52 clang_analyzer_eval(strlen(a) == 3); // expected-warning{{TRUE}} in strlen_constant2() 55 clang_analyzer_eval(strlen(a) == 3); // expected-warning{{UNKNOWN}} in strlen_constant2() 59 return strlen(0); // expected-warning{{Null pointer argument in call to string length function}} in strlen_null() 63 …return strlen((char*)&strlen_fn); // expected-warning{{Argument to string length function is the a… in strlen_fn() 68 …return strlen((char*)&&label); // expected-warning{{Argument to string length function is the addr… in strlen_nonloc() 78 size_t a = strlen(z.a); in strlen_subregion() [all …]
|
/external/llvm-project/compiler-rt/test/profile/ |
D | instrprof-bufferio.c | 48 strlen("Short Strings:\n")); in main() 50 lprofBufferIOWrite(BufferIO, SmallData, strlen(SmallData)); in main() 52 lprofBufferIOWrite(BufferIO, "Long Strings:\n", strlen("Long Strings:\n")); in main() 54 lprofBufferIOWrite(BufferIO, MediumData, strlen(MediumData)); in main() 57 strlen("Extra Long Strings:\n")); in main() 59 lprofBufferIOWrite(BufferIO, LargeData, strlen(LargeData)); in main() 61 lprofBufferIOWrite(BufferIO, "Mixed Strings:\n", strlen("Mixed Strings:\n")); in main() 63 lprofBufferIOWrite(BufferIO, MediumData, strlen(MediumData)); in main() 64 lprofBufferIOWrite(BufferIO, SmallData, strlen(SmallData)); in main() 66 lprofBufferIOWrite(BufferIO, "Endings:\n", strlen("Endings:\n")); in main() [all …]
|
/external/compiler-rt/test/profile/ |
D | instrprof-bufferio.c | 48 strlen("Short Strings:\n")); in main() 50 lprofBufferIOWrite(BufferIO, SmallData, strlen(SmallData)); in main() 52 lprofBufferIOWrite(BufferIO, "Long Strings:\n", strlen("Long Strings:\n")); in main() 54 lprofBufferIOWrite(BufferIO, MediumData, strlen(MediumData)); in main() 57 strlen("Extra Long Strings:\n")); in main() 59 lprofBufferIOWrite(BufferIO, LargeData, strlen(LargeData)); in main() 61 lprofBufferIOWrite(BufferIO, "Mixed Strings:\n", strlen("Mixed Strings:\n")); in main() 63 lprofBufferIOWrite(BufferIO, MediumData, strlen(MediumData)); in main() 64 lprofBufferIOWrite(BufferIO, SmallData, strlen(SmallData)); in main() 66 lprofBufferIOWrite(BufferIO, "Endings:\n", strlen("Endings:\n")); in main() [all …]
|
/external/ltp/testcases/kernel/fs/stream/ |
D | stream03.c | 87 if (fwrite(junk, sizeof(*junk), strlen(junk), stream) == 0) { in main() 94 if (pos != strlen(junk)) { in main() 97 strlen(junk), pos); in main() 113 if (fseek(stream, strlen(junk), 1) != 0) { in main() 120 if (pos != strlen(junk)) { in main() 123 strlen(junk), pos); in main() 135 if (pos != strlen(junk)) { in main() 138 strlen(junk), pos); in main() 163 if (pos != strlen(junk)) { in main() 166 strlen(junk), pos); in main() [all …]
|
/external/llvm-project/clang-tools-extra/test/clang-tidy/checkers/ |
D | bugprone-not-null-terminated-result-strlen.c | 15 position = (char *)memchr(src, '\0', strlen(src)); in bad_memchr_1() 36 memmove(dest, src, strlen(src)); in bad_memmove() 44 memmove_s(dst, 13, src, strlen(src) + 1); in good_memmove() 48 memmove_s(dest, 13, src, strlen(src)); in bad_memmove_s() 54 memmove_s(dest, 13, src, strlen(src) + 1); in good_memmove_s_1() 59 strerror_s(dest, strlen(strerror(errno)), errno); in bad_strerror_s() 67 strerror_s(dst, strlen(strerror(errno)) + 1, errno); in good_strerror_s() 71 return strncmp(str0, str1, (strlen(str0) + 1)); in bad_strncmp_1() 77 return strncmp(str2, str3, 1 + strlen(str2)); in bad_strncmp_2() 83 return strncmp(str4, str5, strlen(str4)); in good_strncmp_1_2() [all …]
|
D | bugprone-not-null-terminated-result-in-initialization-strlen.c | 8 length = strlen(src); in path_sensitive_unknown_length() 13 int length = strlen(src); in bad_memchr() 25 int length = strlen(strerror(errno)); in bad_strerror_s() 35 int length = strlen(strerror(errno)); in good_strerror_s() 40 int length = strlen(str1) + 1; in bad_strncmp_1() 47 int length = strlen(str1) + 1; in good_strncmp_1() 52 return strncmp(str2, "foobar", (strlen("foobar") + 1)); in bad_strncmp_2() 58 return strncmp(str3, "foobar", 1 + strlen("foobar")); in bad_strncmp_3() 64 return strncmp(str, "foobar", strlen("foobar")); in good_strncmp_2_3() 69 int very_long_length_definition_name = strlen(long_source_name); in bad_strxfrm() [all …]
|
D | bugprone-not-null-terminated-result-memcpy-safe.c | 15 memcpy(dest00, src, strlen(src)); in bad_memcpy_not_just_char_dest() 28 memcpy(dest01, src, strlen(src)); in bad_memcpy_known_dest() 45 memcpy(dest20, src, strlen(src)); in bad_memcpy_full_source_length() 58 memcpy(dest21, src, strlen(src) - 1); in bad_memcpy_partial_source_length() 66 strncpy_s(dst21, 14, src, strlen(src) - 1); in good__memcpy_partial_source_length() 74 memcpy_s(dest40, 13, src, strlen(src)); in bad_memcpy_s_unknown_dest() 85 memcpy_s(dest41, 13, src, strlen(src)); in bad_memcpy_s_known_dest() 102 memcpy_s(dest60, 13, src, strlen(src)); in bad_memcpy_s_full_source_length() 115 memcpy_s(dest61, 13, src, strlen(src) - 1); in bad_memcpy_s_partial_source_length() 123 strncpy_s(dst61, 14, src, strlen(src) - 1); in good_memcpy_s_partial_source_length()
|
D | bugprone-misplaced-operator-in-strlen-in-alloc.cpp | 7 size_t strlen(const char *); 14 size_t strlen(const char *); 18 char *new_name = (char *)std::malloc(std::strlen(name + 1)); in bad_std_malloc_std_strlen() 24 char *new_name = (char *)non_std::malloc(std::strlen(name + 1)); in ignore_non_std_malloc_std_strlen() 30 char *new_name = (char *)std::malloc(non_std::strlen(name + 1)); in ignore_std_malloc_non_std_strlen() 36 char *new_name = new char[std::strlen(name + 1)]; in bad_new_strlen() 42 char *new_name = new char[std::strlen(name) + 1]; in good_new_strlen() 55 C *new_name = new C[std::strlen(name + 1)]; in bad_custom_new_strlen()
|
D | bugprone-misplaced-operator-in-strlen-in-alloc.c | 9 size_t strlen(const char *); 20 char *new_name = (char *)malloc(strlen(name + 1)); in bad_malloc() 44 char *new_name = (char *)alloca(strlen(name + 1)); in bad_alloca() 50 char *new_names = (char *)calloc(2, strlen(name + 1)); in bad_calloc() 56 char *new_name = (char *)realloc(old_name, strlen(name + 1)); in bad_realloc() 62 char *new_name = (char *)malloc(strlen(name + 1) + 1); in intentional1() 68 char *new_name = (char *)malloc(strlen(name + 2)); in intentional2() 74 char *new_name = (char *)malloc(strlen((name + 1))); in intentional3() 82 char *new_name = (char *)alloc_ptr(strlen(name + 1)); in bad_indirect_alloc()
|
D | bugprone-not-null-terminated-result-memcpy-safe-cxx.cpp | 15 memcpy(dest00, src, strlen(src)); in bad_memcpy_not_just_char_dest() 28 memcpy(dest01, src, strlen(src)); in bad_memcpy_known_dest() 58 memcpy(dest21, src, strlen(src) - 1); in bad_memcpy_partial_source_length() 66 strncpy_s(dst21, src, strlen(src) - 1); in good_memcpy_partial_source_length() 74 memcpy_s(dest40, 13, src, strlen(src)); in bad_memcpy_s_unknown_dest() 85 memcpy_s(dest41, 13, src, strlen(src)); in bad_memcpy_s_known_dest() 102 memcpy_s(dest60, 13, src, strlen(src)); in bad_memcpy_s_full_source_length() 115 memcpy_s(dest61, 13, src, strlen(src) - 1); in bad_memcpy_s_partial_source_length() 123 strncpy_s(dst61, src, strlen(src) - 1); in good_memcpy_s_partial_source_length()
|
/external/e2fsprogs/intl/ |
D | os2compat.c | 59 size_t sl = strlen (root); in nlos2_initialize() 60 _nlos2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1); in nlos2_initialize() 62 memcpy (_nlos2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1); in nlos2_initialize() 73 size_t sl = strlen (root); in nlos2_initialize() 74 _nlos2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1); in nlos2_initialize() 76 memcpy (_nlos2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1); in nlos2_initialize() 87 size_t sl = strlen (root); in nlos2_initialize() 88 _nlos2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1); in nlos2_initialize() 90 memcpy (_nlos2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1); in nlos2_initialize() 96 if (strlen (_nlos2_localedir) <= MAXPATHLEN) in nlos2_initialize()
|
/external/perfetto/src/trace_processor/importers/json/ |
D | json_trace_tokenizer_unittest.cc | 30 const char* end = start + strlen(start); in TEST() 58 const char* middle = start + strlen(R"({"foo": 1})"); in TEST() 59 const char* end = start + strlen(start); in TEST() 79 const char* end = start + strlen(start); in TEST() 90 const char* middle = start + strlen(R"("Test": )"); in TEST() 91 const char* end = start + strlen(start); in TEST() 102 const char* middle = start + strlen(R"(, "key": )"); in TEST() 103 const char* end = start + strlen(start); in TEST() 114 const char* middle = start + strlen(R"("key2": )"); in TEST() 115 const char* end = start + strlen(start); in TEST() [all …]
|
/external/llvm-project/llvm/test/Transforms/InstCombine/ |
D | strlen-1.ll | 2 ; Test that the strlen library call simplifier works correctly. 16 declare i32 @strlen(i8*) 18 ; Check strlen(string constant) -> integer constant. 25 %hello_l = call i32 @strlen(i8* %hello_p) 34 %null_l = call i32 @strlen(i8* %null_p) 43 %null_hello_l = call i32 @strlen(i8* %null_hello_p) 51 %len = tail call i32 @strlen(i8* @nullstring) nounwind 55 ; Check strlen(x) == 0 --> *x == 0. 62 %hello_l = call i32 @strlen(i8* %hello_p) 73 %str_l = call i32 @strlen(i8* %str_p) [all …]
|
/external/llvm/test/Transforms/InstCombine/ |
D | strlen-1.ll | 2 ; Test that the strlen library call simplifier works correctly. 16 declare i32 @strlen(i8*) 18 ; Check strlen(string constant) -> integer constant. 25 %hello_l = call i32 @strlen(i8* %hello_p) 34 %null_l = call i32 @strlen(i8* %null_p) 43 %null_hello_l = call i32 @strlen(i8* %null_hello_p) 51 %len = tail call i32 @strlen(i8* @nullstring) nounwind 55 ; Check strlen(x) == 0 --> *x == 0. 62 %hello_l = call i32 @strlen(i8* %hello_p) 72 %null_l = call i32 @strlen(i8* %null_p) [all …]
|
/external/kmod/testsuite/ |
D | test-scratchbuf.c | 34 assert_return(scratchbuf_alloc(&sbuf, strlen(smallstr) + 1) == 0, EXIT_FAILURE); in test_scratchbuf_onlystack() 39 assert_return(scratchbuf_alloc(&sbuf, strlen(smallstr) + 1) == 0, EXIT_FAILURE); in test_scratchbuf_onlystack() 43 memcpy(scratchbuf_str(&sbuf), smallstr, strlen(smallstr) + 1); in test_scratchbuf_onlystack() 63 assert_return(scratchbuf_alloc(&sbuf, strlen(smallstr) + 1) == 0, EXIT_FAILURE); in test_scratchbuf_heap() 65 memcpy(scratchbuf_str(&sbuf), smallstr, strlen(smallstr) + 1); in test_scratchbuf_heap() 68 assert_return(scratchbuf_alloc(&sbuf, strlen(largestr) + 1) == 0, EXIT_FAILURE); in test_scratchbuf_heap() 70 assert_return(sbuf.size == strlen(largestr) + 1, EXIT_FAILURE); in test_scratchbuf_heap() 72 memcpy(scratchbuf_str(&sbuf), largestr, strlen(largestr) + 1); in test_scratchbuf_heap() 76 assert_return(scratchbuf_alloc(&sbuf, strlen(largestr2) + 1) == 0, EXIT_FAILURE); in test_scratchbuf_heap() 78 assert_return(sbuf.size == strlen(largestr2) + 1, EXIT_FAILURE); in test_scratchbuf_heap() [all …]
|
/external/igt-gpu-tools/lib/ |
D | igt_pm.c | 65 #define MAX_POLICY_STRLEN strlen(MAX_PERFORMANCE_STR) 83 strlen(__igt_pm_audio_runtime_power_save)) != in __igt_pm_audio_restore_runtime_pm() 84 strlen(__igt_pm_audio_runtime_power_save)) { in __igt_pm_audio_restore_runtime_pm() 96 strlen(__igt_pm_audio_runtime_control)) != in __igt_pm_audio_restore_runtime_pm() 97 strlen(__igt_pm_audio_runtime_control)) { in __igt_pm_audio_restore_runtime_pm() 140 int len = strlen(str); in strchomp() 167 strncmp(de->d_name, match, strlen(match))) in __igt_pm_enable_audio_runtime_pm() 324 strlen(MAX_PERFORMANCE_STR))) in igt_pm_enable_sata_link_power_management() 327 strlen(MEDIUM_POWER_STR))) in igt_pm_enable_sata_link_power_management() 330 strlen(MIN_POWER_STR))) in igt_pm_enable_sata_link_power_management() [all …]
|
/external/ltp/testcases/kernel/pty/ |
D | hangup01.c | 93 size_t len = strlen(MESSAGE1); in parent() 118 strlen(MESSAGE1)) != 0) { in parent() 122 len = strlen(MESSAGE2); in parent() 126 strlen(MESSAGE2)) != 0) { in parent() 130 len = strlen(MESSAGE3); in parent() 134 strlen(MESSAGE3)) != 0) { in parent() 172 if (write(slavefd, MESSAGE1, strlen(MESSAGE1)) != strlen(MESSAGE1)) { in child() 184 if (write(slavefd, MESSAGE2, strlen(MESSAGE2)) != strlen(MESSAGE2)) { in child() 196 if (write(slavefd, MESSAGE3, strlen(MESSAGE3)) != strlen(MESSAGE3)) { in child()
|
/external/openssh/ |
D | md5crypt.c | 47 return (strncmp(salt, magic, strlen(magic)) == 0); in is_md5_salt() 64 if(strncmp(sp, magic, strlen(magic)) == 0) in md5_crypt() 65 sp += strlen(magic); in md5_crypt() 83 MD5_Update(&ctx, pw, strlen(pw)); in md5_crypt() 86 MD5_Update(&ctx, magic, strlen(magic)); in md5_crypt() 93 MD5_Update(&ctx1, pw, strlen(pw)); in md5_crypt() 95 MD5_Update(&ctx1, pw, strlen(pw)); in md5_crypt() 98 for(pl = strlen(pw); pl > 0; pl -= 16) in md5_crypt() 105 for (j = 0, i = strlen(pw); i != 0; i >>= 1) in md5_crypt() 124 MD5_Update(&ctx1, pw, strlen(pw)); in md5_crypt() [all …]
|
/external/protobuf/src/google/protobuf/stubs/ |
D | substitute.h | 92 : text_(value), size_(strlen(text_)) {} in SubstituteArg() 109 : text_(FastInt32ToBuffer(value, scratch_)), size_(strlen(text_)) {} in SubstituteArg() 111 : text_(FastUInt32ToBuffer(value, scratch_)), size_(strlen(text_)) {} in SubstituteArg() 113 : text_(FastInt32ToBuffer(value, scratch_)), size_(strlen(text_)) {} in SubstituteArg() 115 : text_(FastUInt32ToBuffer(value, scratch_)), size_(strlen(text_)) {} in SubstituteArg() 117 : text_(FastLongToBuffer(value, scratch_)), size_(strlen(text_)) {} in SubstituteArg() 119 : text_(FastULongToBuffer(value, scratch_)), size_(strlen(text_)) {} in SubstituteArg() 121 : text_(FastInt64ToBuffer(value, scratch_)), size_(strlen(text_)) {} in SubstituteArg() 123 : text_(FastUInt64ToBuffer(value, scratch_)), size_(strlen(text_)) {} in SubstituteArg() 125 : text_(FloatToBuffer(value, scratch_)), size_(strlen(text_)) {} in SubstituteArg() [all …]
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/ |
D | 3-1.c | 65 if (mq_send(queue, msgptr3, strlen(msgptr3), PRI3) != 0) { in main() 70 if (mq_send(queue, msgptr1, strlen(msgptr1), PRI1) != 0) { in main() 75 if (mq_send(queue, msgptr4, strlen(msgptr4), PRI4) != 0) { in main() 80 if (mq_send(queue, msgptr2, strlen(msgptr2), PRI2) != 0) { in main() 85 if (mq_send(queue, msgptr5, strlen(msgptr5), PRI5) != 0) { in main() 95 if (strncmp(msgptr1, msgrcd, strlen(msgptr1)) != 0) { in main() 105 if (strncmp(msgptr2, msgrcd, strlen(msgptr2)) != 0) { in main() 115 if (strncmp(msgptr3, msgrcd, strlen(msgptr3)) != 0) { in main() 125 if (strncmp(msgptr4, msgrcd, strlen(msgptr4)) != 0) { in main() 135 if (strncmp(msgptr5, msgrcd, strlen(msgptr5)) != 0) { in main()
|
/external/linux-kselftest/tools/testing/selftests/proc/ |
D | proc-pid-vm.c | 315 const size_t len = strlen(buf0) + (g_vsyscall ? strlen(str_vsyscall) : 0); in main() 327 assert(memcmp(buf, buf0, strlen(buf0)) == 0); in main() 329 assert(memcmp(buf + strlen(buf0), str_vsyscall, strlen(str_vsyscall)) == 0); in main() 347 assert(rv >= strlen(buf0)); in main() 348 assert(memcmp(buf, buf0, strlen(buf0)) == 0); in main() 354 assert(memmem(buf, rv, RSS1, strlen(RSS1)) || in main() 355 memmem(buf, rv, RSS2, strlen(RSS2))); in main() 356 assert(memmem(buf, rv, PSS1, strlen(PSS1)) || in main() 357 memmem(buf, rv, PSS2, strlen(PSS2))); in main() 372 assert(memmem(buf, rv, S[i], strlen(S[i]))); in main() [all …]
|
/external/llvm-project/clang-tools-extra/docs/clang-tidy/checks/ |
D | bugprone-misplaced-operator-in-strlen-in-alloc.rst | 1 .. title:: clang-tidy - bugprone-misplaced-operator-in-strlen-in-alloc 3 bugprone-misplaced-operator-in-strlen-in-alloc 6 Finds cases where ``1`` is added to the string in the argument to ``strlen()``, 13 ``strlen()``-like function are ignored, as are cases where the whole addition is 21 char *c = (char*) malloc(strlen(str + 1)); 25 The suggested fix is to add ``1`` to the return value of ``strlen()`` and not 30 char *c = (char*) malloc(strlen(str) + 1); 38 char *c = new char[strlen(str + 1)]; 43 add ``1`` to the return value of ``strlen()`` and not to its argument. In the 48 char *c = new char[strlen(str) + 1]; [all …]
|
/external/jsmn/test/ |
D | tests.c | 107 for (i = 1; i <= strlen(js); i++) { in test_partial_string() 109 if (i == strlen(js)) { in test_partial_string() 130 for (i = 1; i <= strlen(js); i++) { in test_partial_array() 132 if (i == strlen(js)) { in test_partial_array() 158 r = jsmn_parse(&p, js, strlen(js), toksmall, i); in test_array_nomem() 163 r = jsmn_parse(&p, js, strlen(js), toklarge, 10); in test_array_nomem() 182 r = jsmn_parse(&p, js, strlen(js), tok, 10); in test_unquoted_keys() 208 r = jsmn_parse(&p, js, strlen(js), tokens, 128); in test_issue_22() 242 check(jsmn_parse(&p, js, strlen(js), NULL, 0) == 1); in test_count() 246 check(jsmn_parse(&p, js, strlen(js), NULL, 0) == 1); in test_count() [all …]
|