URI: 
       tKeep asking for password if it doesn't match - ratox - FIFO based tox client
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit a91dcb3ae4a5a01a9546d11563198831de1cda7e
   DIR parent 88e7c1199c1b9260bf7bf017363093e1b04e0e10
  HTML Author: sin <sin@2f30.org>
       Date:   Mon, 22 Sep 2014 11:49:53 +0100
       
       Keep asking for password if it doesn't match
       
       Diffstat:
         M ratox.c                             |      24 ++++++++++++++----------
       
       1 file changed, 14 insertions(+), 10 deletions(-)
       ---
   DIR diff --git a/ratox.c b/ratox.c
       t@@ -601,17 +601,21 @@ dataload(void)
                        exit(EXIT_FAILURE);
                }
        
       -        if (encryptsave == 1)
       -                r = tox_encrypted_load(tox, data, sz, passphrase, pplen);
       -        else
       +        if (encryptsave == 1) {
       +                while (1) {
       +                        r = tox_encrypted_load(tox, data, sz, passphrase, pplen);
       +                        if (r < 0)
       +                                readpass();
       +                        else
       +                                break;
       +                }
       +        } else {
                        r = tox_load(tox, data, sz);
       -        if (r < 0) {
       -                fprintf(stderr, "%s failed\n",
       -                        encryptsave == 1 ? "tox_encrypted_load" : "tox_load");
       -                exit(EXIT_FAILURE);
       -        } else if (r == 1) {
       -                fprintf(stderr, "Found encrypted %s but encryption is disabled\n",
       -                        DATAFILE);
       +                if (r < 0)
       +                        fprintf(stderr, "tox_load() failed\n");
       +                else if (r == 1)
       +                        fprintf(stderr, "Found encrypted %s but encryption is disabled\n",
       +                                DATAFILE);
                        exit(EXIT_FAILURE);
                }