MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / main

Function main

oss-fuzz/main.cpp:82–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81#else
82int main(int argc, char * argv[])
83{
84 if (argc < 2 || argc > 3)
85 return EXIT_FAILURE;
86
87 std::ifstream f(argv[1]);
88 if (!f.is_open())
89 return EXIT_FAILURE;
90
91 std::ostringstream oss;
92 oss << f.rdbuf();
93
94 if (!f.good())
95 return EXIT_FAILURE;
96
97 const int cnt = (argc == 3) ? std::stoi(argv[2]) : 1;
98
99 const std::string code = oss.str();
100 for (int i = 0; i < cnt; ++i)
101 doCheck(reinterpret_cast<const unsigned char*>(code.data()), code.size());
102
103 return EXIT_SUCCESS;
104}
105#endif
106
107

Callers

nothing calls this directly

Calls 5

doCheckFunction · 0.85
goodMethod · 0.45
strMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected