Logo Search packages:      
Sourcecode: libtomcrypt version File versions  Download package

const char* error_to_string ( int  err )

Convert an LTC error code to ASCII

Parameters:
errThe error code
Returns:
A pointer to the ASCII NUL terminated string for the error or "Invalid error code." if the err code was not valid.

Definition at line 62 of file error_to_string.c.

Referenced by hmac_test().

{
   if (err < 0 || err >= (int)(sizeof(err_2_str)/sizeof(err_2_str[0]))) {
      return "Invalid error code.";
   } else {
      return err_2_str[err];
   }   
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index