aboutsummaryrefslogtreecommitdiff
path: root/reloc_error.c
blob: afb1bc016fe5c2d1ad293fa842e7d3616c281c3d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "reloc.h"

int reloc_error = 0;
const char *reloc_errors[] = {
    "Success",
    "Read error",
    "Write error",
    "Verification failure",
    "Length too long",
    "Memory allocation failure",
    NULL,
};


const char *reloc_strerror(int code) {
    return reloc_errors[code];
}

void reloc_perror(const char *msg) {
    fprintf(stderr, "%s: %s\n", msg, reloc_strerror(reloc_error));
}