Skip to content

Commit

Permalink
Update properties file for inquiry mode
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Nov 1, 2023
1 parent c65b5cc commit f573406
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 5 additions & 3 deletions cpp/scsidump/scsidump_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,9 +698,11 @@ void ScsiDump::inquiry_info::GeneratePropertiesFile(const string& property_file)
out << "{" << endl
<< " \"vendor\": \"" << vendor << "\"," << endl
<< " \"product\": \"" << product << "\"," << endl
<< " \"revision\": \"" << revision << "\"," << endl
<< " \"block_size\": \"" << sector_size << "\"" << endl
<< "}" << endl;
<< " \"revision\": \"" << revision << "\"";
if (sector_size) {
out << "," << endl << " \"block_size\": \"" << sector_size << "\"";
}
out << endl << "}" << endl;

if (out.fail()) {
cerr << "Error: Can't create properties file '" + property_file + "'" << endl;
Expand Down
3 changes: 1 addition & 2 deletions cpp/test/scsidump_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ TEST(ScsiDumpTest, GeneratePropertiesFile)
expected_str = "{\n"
" \"vendor\": \"\",\n"
" \"product\": \"\",\n"
" \"revision\": \"\",\n"
" \"block_size\": \"0\"\n"
" \"revision\": \"\"\n"
"}\n";
EXPECT_EQ(expected_str, ReadTempFileToString(filename));
remove(filename);
Expand Down

0 comments on commit f573406

Please sign in to comment.