Skip to content

Commit 4845757

Browse files
committed
fixed bugs in argument parsing and file reading routine
1 parent e28ffed commit 4845757

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

3rdparty/Vulkan-Tools

smoke/main.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,21 @@ class Smoke final : public system::IApplicationFramework
5555
for (size_t i = 0;; i++)
5656
{
5757
auto stringifiedIndex = std::to_string(i);
58-
auto outFile = "device_" + stringifiedIndex + ".json";
59-
std::array<char*, 3> args = { arg1.data(), arg2.data(), outFile.data() };
58+
arg1 = "--json=" + stringifiedIndex;
59+
arg3 = "device_" + stringifiedIndex + ".json";
60+
std::array<char*, 3> args = { arg1.data(), arg2.data(), arg3.data() };
6061

6162
int code = nbl::video::vulkaninfo(args);
6263

6364
if (code != 0)
6465
break;
6566

6667
// print out file content
67-
std::ifstream input(outFile);
68+
std::ifstream input(arg3);
6869

69-
while (input >> buf)
70+
while (std::getline(input, buf))
7071
{
71-
std::cout << buf;
72+
std::cout << buf << "\n";
7273
}
7374

7475
std::cout << "\n\n";

0 commit comments

Comments
 (0)