]> git.meshlink.io Git - meshlink/blobdiff - src/meshlink++.h
Fix the C++ wrapper and the examples.
[meshlink] / src / meshlink++.h
index a357cca6516e24d96c0e13e23c7f570b6305b545..1d6c986123c0dd119458c2a9778768cf622269ed 100644 (file)
@@ -182,10 +182,11 @@ namespace meshlink {
                 *  @param nodes        A pointer to an array of pointers to meshlink::node, which should be allocated by the application.
                 *  @param nmemb        The maximum number of pointers that can be stored in the nodes array.
                 *
-                *  @return             The number of known nodes. This can be larger than nmemb, in which case not all nodes were stored in the nodes array.
+                *  @return             The number of known nodes, or -1 in case of an error.
+                *                      This can be larger than nmemb, in which case not all nodes were stored in the nodes array.
                 */
-               size_t get_all_nodes(node **nodes, size_t nmemb) {
-                       return meshlink_get_all_nodes(this, (meshlink_node_t **)nodes, nmemb);
+               node **get_all_nodes(node **nodes, size_t *nmemb) {
+                       return (node **)meshlink_get_all_nodes(this, (meshlink_node_t **)nodes, nmemb);
                }
 
                /// Sign data using the local node's MeshLink key.