summaryrefslogtreecommitdiff
path: root/pullreqd.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2021-06-10 23:43:15 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2021-06-10 23:43:15 -0400
commitefa339fff2de05131785bd0b3cf18a1e7c2c100a (patch)
treea012ef54694328685f8fe3192b83c97371665ae9 /pullreqd.c
parent3b9029a94641563b9dda4f75694e499be9366d0a (diff)
Fixed a typo in `init_socket()`.
Accidentally used `sprintf()`, instead of `snprintf()`.
Diffstat (limited to 'pullreqd.c')
-rw-r--r--pullreqd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pullreqd.c b/pullreqd.c
index a4501c6..d884d63 100644
--- a/pullreqd.c
+++ b/pullreqd.c
@@ -114,7 +114,7 @@ int init_socket(config *cfg) {
return -1;
}
struct addrinfo hints, *ainfo_root, *ainfo;
- const size_t size = sprintf(NULL, "%d", cfg->port) + 1;
+ const size_t size = snprintf(NULL, 0, "%d", cfg->port) + 1;
char *port_str = malloc(size);
sprintf(port_str, "%d", cfg->port);