From: K.Kosako Date: Thu, 8 Aug 2019 04:56:58 +0000 (+0900) Subject: add main function X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c144de9435754c03a512e59997ec975913a78a39;p=onig add main function --- diff --git a/harnesses/syntax-harness.c b/harnesses/syntax-harness.c index 0fb3587..50f154d 100644 --- a/harnesses/syntax-harness.c +++ b/harnesses/syntax-harness.c @@ -118,3 +118,20 @@ int LLVMFuzzerTestOneInput(const uint8_t * Data, size_t Size) return 0; } + +#ifdef WITH_READ_MAIN + +#include + +extern int main(int argc, char* argv[]) +{ + size_t n; + uint8_t Data[10000]; + + n = read(0, Data, sizeof(Data)); + fprintf(stdout, "n: %ld\n", n); + LLVMFuzzerTestOneInput(Data, n); + + return 0; +} +#endif /* WITH_READ_MAIN */