summaryrefslogtreecommitdiff
path: root/pullreqd.c
diff options
context:
space:
mode:
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);