diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2021-06-10 23:43:15 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2021-06-10 23:43:15 -0400 |
commit | efa339fff2de05131785bd0b3cf18a1e7c2c100a (patch) | |
tree | a012ef54694328685f8fe3192b83c97371665ae9 /pullreqd.c | |
parent | 3b9029a94641563b9dda4f75694e499be9366d0a (diff) |
Fixed a typo in `init_socket()`.
Accidentally used `sprintf()`, instead of `snprintf()`.
Diffstat (limited to 'pullreqd.c')
-rw-r--r-- | pullreqd.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |