diff --git a/src/liboping.c b/src/liboping.c index 5253e8c..2470988 100644 --- a/src/liboping.c +++ b/src/liboping.c @@ -1636,10 +1636,8 @@ int ping_host_add (pingobj_t *obj, const char *host) } else { - char errmsg[PING_ERRMSG_LEN]; - - snprintf (errmsg, PING_ERRMSG_LEN, "Unknown `ai_family': %i", ai_ptr->ai_family); - errmsg[PING_ERRMSG_LEN - 1] = '\0'; + char errmsg[64]; + snprintf (errmsg, sizeof(errmsg), "Unknown `ai_family': %d", ai_ptr->ai_family); dprintf ("%s", errmsg); ping_set_error (obj, "getaddrinfo", errmsg);