From ccfd1c2cfc88767988ed48f3ea70c2c08a7853c9 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Sun, 10 Jan 2010 00:36:09 +0100 Subject: [PATCH] fixing make file --- Makefile | 12 ++++++------ mnencd.cpp | 2 -- password.cpp | 3 ++- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 3fdbbe9..3a26f35 100755 --- a/Makefile +++ b/Makefile @@ -1,14 +1,14 @@ -encryptor : main.o password.o mnenc.o - g++ -o mnenc -g -Wall main.o password.o mnenc.o +mnencd : mnencd.o password.o mnenc.o + g++ -o mnencd -g -Wall mnencd.o password.o mnenc.o -main.o: main.cpp password.hpp mnenc.hpp - g++ -c -g -Wall main.cpp +mnencd.o: mnencd.cpp password.hpp mnenc.hpp + g++ -c -g -Wall mnencd.cpp password.o: password.cpp password.hpp g++ -c -g -Wall password.cpp -encryptor.o: mnenc.cpp mnenc.hpp +mnenc.o: mnenc.cpp mnenc.hpp g++ -c -g -Wall mnenc.cpp clean: - rm *.o mnenc + rm *.o mnencd diff --git a/mnencd.cpp b/mnencd.cpp index 52cdace..4d83955 100644 --- a/mnencd.cpp +++ b/mnencd.cpp @@ -115,8 +115,6 @@ int main(int argc, char** argv) { exit(EXIT_FAILURE); } - - /* Change the current working directory */ if ((chdir("/home/micke/.fifo")) < 0) { /* Log the failure */ diff --git a/password.cpp b/password.cpp index 5ec2cd6..3125e05 100644 --- a/password.cpp +++ b/password.cpp @@ -33,7 +33,8 @@ void password::to_string() { bool password::to_file(std::string filename) { bool worked = false; std::ofstream keyfile; - if(keyfile.open(filename.c_str())) { + keyfile.open(filename.c_str()); + if(keyfile.is_open()) { keyfile << encryptedpw; keyfile.close(); worked = true; -- 1.7.9.5