src/liboping.c: Return the number of bytes actually required to store the username
authorFlorian Forster <octo@verplant.org>
Sat, 26 Jan 2008 13:00:02 +0000 (14:00 +0100)
committerFlorian Forster <octo@verplant.org>
Sat, 26 Jan 2008 13:00:02 +0000 (14:00 +0100)
Including the terminating NULL-byte.

src/liboping.c

index 17071fd..0371f15 100644 (file)
@@ -1269,7 +1269,7 @@ int ping_iterator_get_info (pingobj_iter_t *iter, int info,
        {
                case PING_INFO_USERNAME:
                        ret = ENOMEM;
-                       *buffer_len = strlen (iter->username);
+                       *buffer_len = strlen (iter->username) + 1;
                        if (orig_buffer_len <= *buffer_len)
                                break;
                        /* Since (orig_buffer_len > *buffer_len) `strncpy'