Blob


1 #include "got_error.h"
3 #define nitems(a) (sizeof(a) / sizeof((a)[0]))
5 const struct got_error *
6 got_error(int code)
7 {
8 int i;
10 for (i = 0; i < nitems(got_errors); i++) {
11 if (code == got_errors[i].code)
12 return &got_errors[i];
13 }
15 return &got_errors[GOT_ERR_UNKNOWN];
16 }