[PATCH] D27729: [libFuzzer] Diff 20 - Update tests to use more general functions instead of posix specific.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 14:44:12 PST 2016

mpividori added inline comments.

Comment at: lib/Fuzzer/FuzzerUtilWindows.cpp:181-182
+const char *StrStr(const char* Ref, const char* Patt) {
+  return (const char*) fuzzer::SearchMemory(Ref, ::strlen(Ref), Patt,
+    ::strlen(Patt));
zturner wrote:
> Windows has `strstr`, it just doesn't have `strcasestr`.  I would implement this one using just `strstr`.
@zturner , You are right. I confused because I found the function `StrStr()` from Shlwapi.lib . I didn't realized that `strstr()` is part of the std library.
I think it is better to continue with actual implementation of `StrCaseStr()`. By using `std::search()`, we don't have no copy the arrays.
If we want to use `strstr()`, we should copy both arrays, then apply `tolower()`, and then use `strstr()`. This can be slower with large arrays.



More information about the llvm-commits mailing list