src/liboping.c: Fix a (too conservative) off-by-one error in ping_iterator_get_info()
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Tue, 17 Feb 2009 12:15:39 +0000 (13:15 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Tue, 17 Feb 2009 12:15:39 +0000 (13:15 +0100)
Signed-off-by: Florian Forster <octo@leeloo.lan.home.verplant.org>
src/liboping.c

index 02125e2..6ffb482 100644 (file)
@@ -1292,7 +1292,7 @@ int ping_iterator_get_info (pingobj_iter_t *iter, int info,
                case PING_INFO_HOSTNAME:
                        ret = ENOMEM;
                        *buffer_len = strlen (iter->hostname) + 1;
-                       if (orig_buffer_len <= *buffer_len)
+                       if (orig_buffer_len < *buffer_len)
                                break;
                        /* Since (orig_buffer_len > *buffer_len) `strncpy'
                         * will copy `*buffer_len' and pad the rest of