MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / strerror_r

Function strerror_r

libhb/compat.c:53–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51#define ERRSTR_LEN 20
52
53int strerror_r(int errnum, char *strerrbuf, size_t buflen)
54{
55 int ret = 0;
56 char errstr[ERRSTR_LEN];
57
58 if (strerrbuf == NULL || buflen == 0)
59 {
60 ret = ERANGE;
61 goto done;
62 }
63
64 if(snprintf(errstr, ERRSTR_LEN - 1, "unknown error %d", errnum) < 0)
65 {
66 ret = EINVAL;
67 goto done;
68 }
69
70 if (snprintf(strerrbuf, buflen, errstr) < 0)
71 {
72 ret = EINVAL;
73 goto done;
74 }
75
76done:
77 return ret;
78}
79#endif // _GNU_SOURCE
80#endif // HAS_STRERROR_R

Callers 3

hb_save_previewFunction · 0.85
hb_read_previewFunction · 0.85
encavcodecInitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected