diff options
-rw-r--r-- | unix/vncpasswd/vncpasswd.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/unix/vncpasswd/vncpasswd.cxx b/unix/vncpasswd/vncpasswd.cxx index b17e73dd..6666955f 100644 --- a/unix/vncpasswd/vncpasswd.cxx +++ b/unix/vncpasswd/vncpasswd.cxx @@ -139,14 +139,12 @@ static std::vector<uint8_t> readpassword() { perror("getpassword error"); exit(1); } + std::string first = passwd; - if (first.size() < 6) { - if (first.empty()) { - fprintf(stderr,"Password not changed\n"); - exit(1); - } - fprintf(stderr,"Password must be at least 6 characters - try again\n"); - continue; + + if (first.empty()) { + fprintf(stderr,"Password not changed\n"); + exit(1); } if (first.size() > 8) { @@ -161,6 +159,11 @@ static std::vector<uint8_t> readpassword() { printf("Password quality check failed, please set it correctly.\n"); continue; } +#else + if (first.size() < 6) { + fprintf(stderr,"Password must be at least 6 characters - try again\n"); + continue; + } #endif passwd = getpassword("Verify:"); |