aboutsummaryrefslogtreecommitdiff
path: root/gmid.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-01-24 10:39:48 +0000
committerOmar Polo <op@omarpolo.com>2021-01-24 10:39:48 +0000
commit8d6ae384be450ca7b53b0a718249a86fb46bf412 (patch)
treea2cf4371d1128d168495af2febbabd44c7dbc688 /gmid.c
parent7b31a6386d6f80a3dd79af7d56bbf48b6eb7a264 (diff)
move configuration init stuff in its own function
Diffstat (limited to 'gmid.c')
-rw-r--r--gmid.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gmid.c b/gmid.c
index b72f571..720268f 100644
--- a/gmid.c
+++ b/gmid.c
@@ -362,13 +362,10 @@ usage(const char *me)
me);
}
-int
-main(int argc, char **argv)
+void
+init_config(void)
{
- int ch, p[2];
- const char *config_path = NULL;
size_t i;
- int conftest = 0;
bzero(hosts, sizeof(hosts));
for (i = 0; i < HOSTSLEN; ++i)
@@ -380,6 +377,14 @@ main(int argc, char **argv)
conf.protos = TLS_PROTOCOL_TLSv1_2 | TLS_PROTOCOL_TLSv1_3;
init_mime(&conf.mime);
+}
+
+int
+main(int argc, char **argv)
+{
+ int ch, p[2];
+ const char *config_path = NULL;
+ int conftest = 0;
while ((ch = getopt(argc, argv, "6C:c:d:fhK:np:x:")) != -1) {
switch (ch) {