From d2f8fa5a36dcb1ceb29b39351b4f726945f4a6bb Mon Sep 17 00:00:00 2001 From: Caleb Leak Date: Sat, 9 Feb 2019 20:55:54 -0800 Subject: [PATCH] Fixed printing of wrong file names In multiple samples when a file didn't exist, it printed the first file as being the offending argument, regardless of which actually was. --- samples/frame_generator.cpp | 2 +- samples/gltf_viewer.cpp | 2 +- samples/lightbulb.cpp | 2 +- samples/material_sandbox.cpp | 2 +- samples/sample_cloth.cpp | 2 +- samples/sample_full_pbr.cpp | 2 +- samples/sample_normal_map.cpp | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/samples/frame_generator.cpp b/samples/frame_generator.cpp index 00caaa429b..03e7656916 100644 --- a/samples/frame_generator.cpp +++ b/samples/frame_generator.cpp @@ -428,7 +428,7 @@ int main(int argc, char* argv[]) { for (int i = option_index; i < argc; i++) { utils::Path filename = argv[i]; if (!filename.exists()) { - std::cerr << "file " << argv[option_index] << " not found!" << std::endl; + std::cerr << "file " << argv[i] << " not found!" << std::endl; return 1; } g_filenames.push_back(filename); diff --git a/samples/gltf_viewer.cpp b/samples/gltf_viewer.cpp index cd81f18450..35e70839fa 100644 --- a/samples/gltf_viewer.cpp +++ b/samples/gltf_viewer.cpp @@ -168,7 +168,7 @@ int main(int argc, char* argv[]) { for (int i = option_index; i < argc; i++) { utils::Path filename = argv[i]; if (!filename.exists()) { - std::cerr << "file " << argv[option_index] << " not found!" << std::endl; + std::cerr << "file " << argv[i] << " not found!" << std::endl; return 1; } g_filenames.push_back(filename); diff --git a/samples/lightbulb.cpp b/samples/lightbulb.cpp index 0a80fd8ca3..9dba8aedee 100644 --- a/samples/lightbulb.cpp +++ b/samples/lightbulb.cpp @@ -423,7 +423,7 @@ int main(int argc, char* argv[]) { for (int i = option_index; i < argc; i++) { utils::Path filename = argv[i]; if (!filename.exists()) { - std::cerr << "file " << argv[option_index] << " not found!" << std::endl; + std::cerr << "file " << argv[i] << " not found!" << std::endl; return 1; } g_filenames.push_back(filename); diff --git a/samples/material_sandbox.cpp b/samples/material_sandbox.cpp index a51f3e4322..11235182f0 100644 --- a/samples/material_sandbox.cpp +++ b/samples/material_sandbox.cpp @@ -389,7 +389,7 @@ int main(int argc, char* argv[]) { for (int i = option_index; i < argc; i++) { utils::Path filename = argv[i]; if (!filename.exists()) { - std::cerr << "file " << argv[option_index] << " not found!" << std::endl; + std::cerr << "file " << argv[i] << " not found!" << std::endl; return 1; } g_filenames.push_back(filename); diff --git a/samples/sample_cloth.cpp b/samples/sample_cloth.cpp index 81cf26e8ed..fe1ca452eb 100644 --- a/samples/sample_cloth.cpp +++ b/samples/sample_cloth.cpp @@ -247,7 +247,7 @@ int main(int argc, char* argv[]) { for (int i = option_index; i < argc; i++) { utils::Path filename = argv[i]; if (!filename.exists()) { - std::cerr << "file " << argv[option_index] << " not found!" << std::endl; + std::cerr << "file " << argv[i] << " not found!" << std::endl; return 1; } g_filenames.push_back(filename); diff --git a/samples/sample_full_pbr.cpp b/samples/sample_full_pbr.cpp index 8426f7016a..50f46542fa 100644 --- a/samples/sample_full_pbr.cpp +++ b/samples/sample_full_pbr.cpp @@ -377,7 +377,7 @@ int main(int argc, char* argv[]) { for (int i = option_index; i < argc; i++) { utils::Path filename = argv[i]; if (!filename.exists()) { - std::cerr << "file " << argv[option_index] << " not found!" << std::endl; + std::cerr << "file " << argv[i] << " not found!" << std::endl; return 1; } g_filenames.push_back(filename); diff --git a/samples/sample_normal_map.cpp b/samples/sample_normal_map.cpp index 23c23bc11b..b741273f33 100644 --- a/samples/sample_normal_map.cpp +++ b/samples/sample_normal_map.cpp @@ -337,7 +337,7 @@ int main(int argc, char* argv[]) { for (int i = option_index; i < argc; i++) { utils::Path filename = argv[i]; if (!filename.exists()) { - std::cerr << "file " << argv[option_index] << " not found!" << std::endl; + std::cerr << "file " << argv[i] << " not found!" << std::endl; return 1; } g_filenames.push_back(filename);