ch1-02.c 388 B

12345678910111213141516171819202122232425
  1. /*
  2. * Name : ch1-02.c
  3. * Purpose : Demonstration of error handling
  4. * Author : Tom St Denis
  5. *
  6. * History : v0.79 Initial release
  7. */
  8. /* ch1-01-1 */
  9. #include <mycrypt.h>
  10. int main(void)
  11. {
  12. int errno;
  13. if ((errno = some_func(...)) != CRYPT_OK) {
  14. printf("Error: %s\n", error_to_string(errno));
  15. return EXIT_FAILURE;
  16. }
  17. return 0;
  18. }
  19. /*ch1-01-1 */