Skip to content

Commit

Permalink
Remove key_err and remove trailing space after output
Browse files Browse the repository at this point in the history
  • Loading branch information
aarikpokras authored Dec 3, 2024
1 parent 300a38d commit 21bf738
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ int main(int argc, char *argv[]) {
if (out_x[0] == "err") {
cerr << "Error: the file could not be opened." << endl;
return 2;
} else if (out_x[0] == "key_err") {
cerr << "Error: the specified key " << key_ << " does not exist." << endl;
return 2;
} else {
string out;
for (size_t i = 0; i < out_x.size(); i++) {
cout << out_x[i] << delim;
out += out_x[i];
out += delim;
}
out.erase(out.size()-1, out.size()); // Trim off the trailing out delim
cout << out << endl;
}
} else {
cout << "Usage: " << argv[0] << " key=[key] file=[file] amt=[amount]" << endl;
Expand Down

0 comments on commit 21bf738

Please sign in to comment.