mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-02 01:17:52 +03:00
error: Add ssh_reset_error() function
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -232,6 +232,7 @@ void _ssh_set_error_oom(void *error, const char *function);
|
||||
_ssh_set_error_invalid(error, __func__)
|
||||
void _ssh_set_error_invalid(void *error, const char *function);
|
||||
|
||||
void ssh_reset_error(void *error);
|
||||
|
||||
/* server.c */
|
||||
#ifdef WITH_SERVER
|
||||
|
||||
15
src/error.c
15
src/error.c
@@ -103,6 +103,21 @@ void _ssh_set_error_invalid(void *error, const char *function)
|
||||
"Invalid argument in %s", function);
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @brief Reset the error code and message
|
||||
*
|
||||
* @param error The place to reset the error.
|
||||
*/
|
||||
void ssh_reset_error(void *error)
|
||||
{
|
||||
struct ssh_common_struct *err = error;
|
||||
|
||||
ZERO_STRUCT(err->error.error_buffer);
|
||||
err->error.error_code = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieve the error text message from the last error.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user