Pārlūkot izejas kodu

- 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 gadus atpakaļ
vecāks
revīzija
ba2bfd54ed
1 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. 3
    3
      src/util/mucurses_test.c

+ 3
- 3
src/util/mucurses_test.c Parādīt failu

@@ -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 );

Notiek ielāde…
Atcelt
Saglabāt