Ver código fonte

- modified length of password string to match visible field length

- value of n passed to wgetnstr should now be equivalent to output from strlen (i.e. length excluding NUL-terminating character)
tags/v0.9.3
Dan Lynch 18 anos atrás
pai
commit
ba2bfd54ed
1 arquivos alterados com 3 adições e 3 exclusões
  1. 3
    3
      src/util/mucurses_test.c

+ 3
- 3
src/util/mucurses_test.c Ver arquivo

@@ -25,7 +25,7 @@ int main ( void ) {
25 25
 void get_iscsi_chap_secret( char *sec ) {
26 26
 	char 	*title = "Set new iSCSI CHAP secret",
27 27
 		*msg = "Configure the iSCSI access secret",
28
-		pw1[16], pw2[16];
28
+		pw1[17], pw2[17];
29 29
 	WINDOW *secret;
30 30
 
31 31
 	secret = newwin( stdscr->height / 2,
@@ -44,9 +44,9 @@ void get_iscsi_chap_secret( char *sec ) {
44 44
 	mvwhline( secret, 8, 12, '_' | secret->attrs, 16 );
45 45
 
46 46
 	wmove( secret, 6, 12 );
47
-	wgetnstr( secret, pw1, 12 );
47
+	wgetnstr( secret, pw1, 16 );
48 48
 	wmove( secret, 8, 12 );
49
-	wgetnstr( secret, pw2, 12 );
49
+	wgetnstr( secret, pw2, 16 );
50 50
 
51 51
 	if ( strcmp( pw1, pw2 ) == 0 ) {
52 52
 		strcpy( sec, pw1 );

Carregando…
Cancelar
Salvar