From 21bf7383c6b2ea59d621540c24b82eda86aa4099 Mon Sep 17 00:00:00 2001 From: Aarik Pokras <85502246+aarikpokras@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:48:12 -0500 Subject: [PATCH] Remove `key_err` and remove trailing space after output --- src/main.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 6eb81a8..3b36325 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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;