made hcl immune to an error number/message set in the log_write callback
This commit is contained in:
13
lib/err.c
13
lib/err.c
@ -297,8 +297,17 @@ const hcl_ooch_t* hcl_backuperrmsg (hcl_t* hcl)
|
||||
return hcl->errmsg.tmpbuf.ooch;
|
||||
}
|
||||
|
||||
void hcl_seterrnum (hcl_t* hcl, hcl_errnum_t errnum)
|
||||
{
|
||||
if (hcl->shuterr) return;
|
||||
hcl->errnum = errnum;
|
||||
hcl->errmsg.len = 0;
|
||||
}
|
||||
|
||||
void hcl_seterrwithsyserr (hcl_t* hcl, int syserr)
|
||||
{
|
||||
if (hcl->shuterr) return;
|
||||
|
||||
if (hcl->vmprim.syserrstrb)
|
||||
{
|
||||
hcl->vmprim.syserrstrb (hcl, syserr, hcl->errmsg.tmpbuf.bch, HCL_COUNTOF(hcl->errmsg.tmpbuf.bch));
|
||||
@ -323,6 +332,8 @@ void hcl_setsynerrbfmt (hcl_t* hcl, hcl_synerrnum_t num, const hcl_ioloc_t* loc,
|
||||
{
|
||||
static hcl_bch_t syntax_error[] = "syntax error - ";
|
||||
|
||||
if (hcl->shuterr) return;
|
||||
|
||||
if (msgfmt)
|
||||
{
|
||||
va_list ap;
|
||||
@ -372,6 +383,8 @@ void hcl_setsynerrufmt (hcl_t* hcl, hcl_synerrnum_t num, const hcl_ioloc_t* loc,
|
||||
{
|
||||
static hcl_bch_t syntax_error[] = "syntax error - ";
|
||||
|
||||
if (hcl->shuterr) return;
|
||||
|
||||
if (msgfmt)
|
||||
{
|
||||
va_list ap;
|
||||
|
Reference in New Issue
Block a user