Skip to content

error-crypt.h

Functions

Name
void wc_ErrorString(int err, char * buff)
This function stores the error string for a particular error code in the given buffer.
const char * wc_GetErrorString(int error)
This function returns the error string for a particular error code.

Functions Documentation

function wc_ErrorString

void wc_ErrorString(
    int err,
    char * buff
)

This function stores the error string for a particular error code in the given buffer.

Parameters:

  • error error code for which to get the string
  • buffer buffer in which to store the error string. Buffer should be at least WOLFSSL_MAX_ERROR_SZ (80 bytes) long

See: wc_GetErrorString

Return: none No returns.

Example

char errorMsg[WOLFSSL_MAX_ERROR_SZ];
int err = wc_some_function();

if( err != 0) { // error occurred
    wc_ErrorString(err, errorMsg);
}

function wc_GetErrorString

const char * wc_GetErrorString(
    int error
)

This function returns the error string for a particular error code.

Parameters:

  • error error code for which to get the string

See: wc_ErrorString

Return: string Returns the error string for an error code as a string literal.

Example

char * errorMsg;
int err = wc_some_function();

if( err != 0) { // error occurred
    errorMsg = wc_GetErrorString(err);
}

Source code


void wc_ErrorString(int err, char* buff);

const char* wc_GetErrorString(int error);

Updated on 2024-11-22 at 01:12:39 +0000