aboutsummaryrefslogtreecommitdiffstats
path: root/main/mosquitto/mosquitto_passwd-flush.patch
blob: 19288992e11dbda3535d8a229e4fd72a04b55723 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/mosquitto_passwd.c b/src/mosquitto_passwd.c
index ea8c315..5b303c1 100644
--- a/src/mosquitto_passwd.c
+++ b/src/mosquitto_passwd.c
@@ -288,6 +288,7 @@ int get_password(char *password, int len)
 	char pw1[MAX_BUFFER_LEN], pw2[MAX_BUFFER_LEN];
 
 	printf("Password: ");
+	fflush(stdout);
 	if(gets_quiet(pw1, MAX_BUFFER_LEN)){
 		fprintf(stderr, "Error: Empty password.\n");
 		return 1;
@@ -295,6 +296,7 @@ int get_password(char *password, int len)
 	printf("\n");
 
 	printf("Reenter password: ");
+	fflush(stdout);
 	if(gets_quiet(pw2, MAX_BUFFER_LEN)){
 		fprintf(stderr, "Error: Empty password.\n");
 		return 1;