]> ToastFreeware Gitweb - gregoa/bti.git/blobdiff - bti.c
Disable echo when reading the password
[gregoa/bti.git] / bti.c
diff --git a/bti.c b/bti.c
index bf01e72077abd3e0721bbc25b46cfd08a09172de..30963b25a36f4711cf7e4e039c6f7f4b5b313213 100644 (file)
--- a/bti.c
+++ b/bti.c
@@ -670,7 +670,9 @@ void read_password(char *buf, size_t len)
 
        fprintf(stdout, "Enter twitter password: ");
        fflush(stdout);
+       tcflow(0, TCOOFF);
        scanf("%79s", pwd);
+       tcflow(0, TCOON);
        fprintf(stdout, "\n");
 
        tcsetattr(0, TCSANOW, &old);
@@ -1114,10 +1116,8 @@ int main(int argc, char *argv[], char *envp[])
         * Show the version to make it easier to determine what
         * is going on here
         */
-       if (debug) {
+       if (debug)
                display_version();
-               fprintf(stderr, "%s", session->group);
-       }
 
        if (session->action == ACTION_UNKNOWN) {
                fprintf(stderr, "Unknown action, valid actions are:\n");
@@ -1144,7 +1144,6 @@ int main(int argc, char *argv[], char *envp[])
        if (!session->password) {
                read_password(password, sizeof(password));
                session->password = strdup(password);
-               free(password);
        }
 
        if (session->action == ACTION_UPDATE) {