Jernej Kovacic wrote: > On success, the function returns the number of algorithms for the > given method_type (a positive number), allocates the array and > appropriately fills it (it will not be NULL terminated). On failure > (e.g. unsuccessful allocation, etc.) it returns an error code (a > negative number). Internally, LIBSSH2_ALLOC will be used to allocate > the appropriate amount of memory. > > If the function fails it will free the allocated memory (if necessary) itself. > If the function succeeds and returns a valid list, the user must free > it when he doesn't need it anymore. This is done by calling > libssh2_free (which actually calls LIBSSH2_FREE).
Also describe and make sure to document the case when the function returns 0, even if it is just theoretical it is critical to not leave any case unclear. //Peter _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel