Skip to content

Commit

Permalink
Added undefined guards
Browse files Browse the repository at this point in the history
  • Loading branch information
cheng-alvin committed Nov 28, 2023
1 parent 1e38547 commit 56f77c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libjas/error.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "error.h"

char *jasErrorno(jasErrorCode_t c) {
char *codes[] = {"JAS_NO_ERROR", "JAS_ERROR_UNDEFINED_POINTER"}; // TODO Add more error codes here!
char *codes[] = {"JAS_NO_ERROR", "JAS_ERROR_UNDEFINED_POINTER"}; // TODO Add more error codes
if (c > sizeof(c) * sizeof(char *))
return "JAS_NO_ERROR_CODE";
return codes[c];
}

0 comments on commit 56f77c5

Please sign in to comment.