Skip to content

Commit

Permalink
Fix format-truncation warning
Browse files Browse the repository at this point in the history
Found by: Geo
Patch by: michaelortmann
  • Loading branch information
michaelortmann authored Dec 1, 2024
1 parent 1effc20 commit a5f1d67
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,8 @@ void *thread_dns_ipbyhost(void *arg)
else if (error == EAI_NONAME)
snprintf(dtn->strerror, sizeof dtn->strerror, "dns: thread_dns_ipbyhost(): getaddrinfo(): not known");
else if (error == EAI_SYSTEM) {
snprintf(dtn->strerror, sizeof dtn->strerror, "dns: thread_dns_ipbyhost(): getaddrinfo(): %s: %s", gai_strerror(error), strerror(errno));
/* print raw errno, dont use strerror() in thread and dont use strerror_r() due to GNU / POSIX portability complexity */
snprintf(dtn->strerror, sizeof dtn->strerror, "dns: thread_dns_ipbyhost(): getaddrinfo(): %s: errno %i", gai_strerror(error), errno);
} else
snprintf(dtn->strerror, sizeof dtn->strerror, "dns: thread_dns_ipbyhost(): getaddrinfo(): %s", gai_strerror(error));
close(dtn->fildes[1]);
Expand Down

0 comments on commit a5f1d67

Please sign in to comment.