aboutsummaryrefslogtreecommitdiff
path: root/gg.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-01-23 17:07:52 +0000
committerOmar Polo <op@omarpolo.com>2021-01-23 17:07:52 +0000
commitd760973a5b59906e46def02f8e5aaaf7be601eba (patch)
treeea006f8d3c387d062324a35dcb7adc406c5c5759 /gg.c
parent497977d501eb736c37353ec8fa4c83315e025bc0 (diff)
don't alter the struct iri
Diffstat (limited to 'gg.c')
-rw-r--r--gg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gg.c b/gg.c
index 376bc49..c8b40bb 100644
--- a/gg.c
+++ b/gg.c
@@ -102,9 +102,9 @@ main(int argc, char **argv)
if (tls_configure(ctx, conf) == -1)
errx(1, "tls_configure: %s", tls_error(ctx));
- if (*iri.port == '\0')
- iri.port = (char*)port;
- if (tls_connect(ctx, iri.host, iri.port) == -1)
+ if (*iri.port != '\0')
+ port = iri.port;
+ if (tls_connect(ctx, iri.host, port) == -1)
errx(1, "tls_connect: %s", tls_error(ctx));
tls_write(ctx, req, strlen(req));