示例#1
0
void njb_error_add2 (njb_t *njb, const char *sub, const char *prefix, int code)
{
    __dsub= "njb_error_add2";
    njb_error_stack_t *estack;
    char *ep;

    __enter;

    ep = (char *) malloc(MAX_ERRLEN);

    if ( error_overflow(njb) ) {
        __leave;
        return;
    }

    snprintf(ep, MAX_ERRLEN, "%s: %s: %s", sub, prefix,
             njb_error_string(code));

    /* Add to error stack */
    estack = (njb_error_stack_t *) njb->error_stack;
    estack->msg[estack->count] = ep;

    estack->count++;
    __leave;
}
示例#2
0
文件: error.c 项目: cerijerome/ceri
void error_add (int code)
{
	char *ep= estack.msg[estack.count];

	if ( error_overflow() ) return;

	snprintf(ep, MAX_ERRLEN, "%s", error_string(code));

	irlinc_error= code;
	estack.count++;
}