fixing make file
authorMicke Nordin <micke@hal.mickenordin.se>
Sat, 9 Jan 2010 23:36:09 +0000 (00:36 +0100)
committerMicke Nordin <micke@hal.mickenordin.se>
Sat, 9 Jan 2010 23:36:09 +0000 (00:36 +0100)
Makefile
mnencd.cpp
password.cpp

index 3fdbbe9..3a26f35 100755 (executable)
--- 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
        
 
 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:
        g++ -c -g -Wall mnenc.cpp
        
 clean:
-       rm *.o mnenc
+       rm *.o mnencd
index 52cdace..4d83955 100644 (file)
@@ -115,8 +115,6 @@ int main(int argc, char** argv) {
                exit(EXIT_FAILURE);
        }
        
                exit(EXIT_FAILURE);
        }
        
-
-       
        /* Change the current working directory */
        if ((chdir("/home/micke/.fifo")) < 0) {
                /* Log the failure */
        /* Change the current working directory */
        if ((chdir("/home/micke/.fifo")) < 0) {
                /* Log the failure */
index 5ec2cd6..3125e05 100644 (file)
@@ -33,7 +33,8 @@ void password::to_string() {
 bool password::to_file(std::string filename) {
        bool worked = false;
        std::ofstream keyfile;
 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;
                keyfile << encryptedpw;
                keyfile.close();
                worked = true;