Browse Source

- 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 years ago
parent
commit
ba2bfd54ed
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      src/util/mucurses_test.c

+ 3
- 3
src/util/mucurses_test.c View File

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

Loading…
Cancel
Save