Skip to content

Commit

Permalink
fix .txt renaming input bug
Browse files Browse the repository at this point in the history
  • Loading branch information
raybellis committed Oct 28, 2019
1 parent 4d604e5 commit d4f53be
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions dnscvt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ int main(int argc, char *argv[])

// remove .txt extension if found
std::string input(argv[1]);
if (ends_with(input, ".txt")) {
input.erase(input.length() - 4);
std::string output = input;

if (ends_with(output, ".txt")) {
output.erase(output.length() - 4);
}

// append .raw
std::string output = input + ".raw";
output += ".raw";

// start the conversion
qf.read_txt(input);
Expand Down

0 comments on commit d4f53be

Please sign in to comment.