diff options
Diffstat (limited to 'unix/vncpasswd/vncpasswd.cxx')
-rw-r--r-- | unix/vncpasswd/vncpasswd.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/unix/vncpasswd/vncpasswd.cxx b/unix/vncpasswd/vncpasswd.cxx index 30091a3d..877ebcbd 100644 --- a/unix/vncpasswd/vncpasswd.cxx +++ b/unix/vncpasswd/vncpasswd.cxx @@ -72,7 +72,7 @@ static const char* getpassword(const char* prompt) { result[strlen(result)-1] = 0; return buf; } - return 0; + return nullptr; } // Reads passwords from stdin and prints encrypted passwords to stdout. @@ -81,7 +81,7 @@ static int encrypt_pipe() { // We support a maximum of two passwords right now for (i = 0;i < 2;i++) { - const char *result = getpassword(NULL); + const char *result = getpassword(nullptr); if (!result) break; @@ -102,7 +102,7 @@ static int encrypt_pipe() { static std::vector<uint8_t> readpassword() { while (true) { const char *passwd = getpassword("Password:"); - if (passwd == NULL) { + if (passwd == nullptr) { perror("getpassword error"); exit(1); } @@ -117,7 +117,7 @@ static std::vector<uint8_t> readpassword() { } passwd = getpassword("Verify:"); - if (passwd == NULL) { + if (passwd == nullptr) { perror("getpass error"); exit(1); } @@ -158,7 +158,7 @@ int main(int argc, char** argv) if (fname[0] == '\0') { const char *configDir = os::getvncconfigdir(); - if (configDir == NULL) { + if (configDir == nullptr) { fprintf(stderr, "Can't obtain VNC config directory\n"); exit(1); } @@ -175,7 +175,7 @@ int main(int argc, char** argv) fprintf(stderr, "Would you like to enter a view-only password (y/n)? "); char yesno[3]; - if (fgets(yesno, 3, stdin) != NULL && (yesno[0] == 'y' || yesno[0] == 'Y')) { + if (fgets(yesno, 3, stdin) != nullptr && (yesno[0] == 'y' || yesno[0] == 'Y')) { obfuscatedReadOnly = readpassword(); } else { fprintf(stderr, "A view-only password is not used\n"); |