[PATCH 06/10] Replace literal "80" with a named constant

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Kevin Cernekee <cernekee at gmail.com>
---
 main.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/main.c b/main.c
index e68ff29..4d5cb0e 100644
--- a/main.c
+++ b/main.c
@@ -73,6 +73,9 @@ static int process_auth_form(void *_vpninfo,
 #include "version.c"
 #undef openconnect_version_str
 
+/* Default size for user responses */
+#define USER_BUFLEN 80
+
 int verbose = PRG_INFO;
 int background;
 int do_passphrase_from_fsid;
@@ -973,7 +976,7 @@ static int validate_peer_cert(void *_vpninfo, OPENCONNECT_X509 *peer_cert,
 	}
 
 	while (1) {
-		char buf[80];
+		char buf[USER_BUFLEN];
 		char *details;
 		char *p;
 
@@ -1062,11 +1065,11 @@ static int prompt_opt(struct openconnect_info *vpninfo, struct oc_form_opt *opt,
 		return -1;
 	}
 
-	opt->value=malloc(80);
+	opt->value = malloc(USER_BUFLEN);
 	if (!opt->value)
 		return -1;
 
-	ret = prompt_user(opt->label, opt->value, 80, hide_chars);
+	ret = prompt_user(opt->label, opt->value, USER_BUFLEN, hide_chars);
 
 	if (ret < 0) {
 		free(opt->value);
-- 
1.7.5.4




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux