From 6d35f0cbf1cb30913020be3b78028ae8299332f0 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 26 Jan 2008 13:58:30 +0100 Subject: [PATCH] src/liboping.c: Return the number of bytes actually required to store the hostname Including the terminating NULL-byte. --- src/liboping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/liboping.c b/src/liboping.c index f749301..62bc461 100644 --- a/src/liboping.c +++ b/src/liboping.c @@ -1239,7 +1239,7 @@ int ping_iterator_get_info (pingobj_iter_t *iter, int info, { case PING_INFO_HOSTNAME: ret = ENOMEM; - *buffer_len = strlen (iter->hostname); + *buffer_len = strlen (iter->hostname) + 1; if (orig_buffer_len <= *buffer_len) break; /* Since (orig_buffer_len > *buffer_len) `strncpy' -- 2.30.2