summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerUtil.cpp')
-rw-r--r--llvm/lib/Fuzzer/FuzzerUtil.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerUtil.cpp b/llvm/lib/Fuzzer/FuzzerUtil.cpp
index ec592e03f23..420f05d05c4 100644
--- a/llvm/lib/Fuzzer/FuzzerUtil.cpp
+++ b/llvm/lib/Fuzzer/FuzzerUtil.cpp
@@ -164,9 +164,11 @@ bool ToASCII(uint8_t *Data, size_t Size) {
return Changed;
}
-bool IsASCII(const Unit &U) {
- for (auto X : U)
- if (!(isprint(X) || isspace(X))) return false;
+bool IsASCII(const Unit &U) { return IsASCII(U.data(), U.size()); }
+
+bool IsASCII(const uint8_t *Data, size_t Size) {
+ for (size_t i = 0; i < Size; i++)
+ if (!(isprint(Data[i]) || isspace(Data[i]))) return false;
return true;
}
OpenPOWER on IntegriCloud