Keep improving EH

This commit is contained in:
Vitor Santos Costa 2016-12-10 01:07:57 -06:00
parent cbb0d81ac4
commit 5526dc48bf

View File

@ -311,24 +311,24 @@ yap_error_descriptor_t *Yap_popErrorContext(void) {
} }
void Yap_ThrowError__(const char *file, const char *function, int lineno, void Yap_ThrowError__(const char *file, const char *function, int lineno,
yap_error_number type, Term where, ...) { yap_error_number type, Term where, ...) {
va_list ap; va_list ap;
char tmpbuf[MAXPATHLEN]; char tmpbuf[MAXPATHLEN];
va_start(ap, where); va_start(ap, where);
char *format = va_arg(ap, char *); char *format = va_arg(ap, char *);
if (format != NULL) { if (format != NULL) {
#if HAVE_VSNPRINTF #if HAVE_VSNPRINTF
(void)vsnprintf(tmpbuf, MAXPATHLEN - 1, format, ap); (void)vsnprintf(tmpbuf, MAXPATHLEN - 1, format, ap);
#else #else
(void)vsprintf(tnpbuf, format, ap); (void)vsprintf(tnpbuf, format, ap);
#endif #endif
// fprintf(stderr, "warning: "); // fprintf(stderr, "warning: ");
Yap_Error__(file, function, lineno, type, where, tmpbuf); Yap_Error__(file, function, lineno, type, where, tmpbuf);
} else { } else {
Yap_Error__(file, function, lineno, type, where); Yap_Error__(file, function, lineno, type, where);
} }
siglongjmp(LOCAL_RestartEnv, 4); siglongjmp(LOCAL_RestartEnv, 4);
} }
/** /**