X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Ferror.c;h=46972f5cb660601923d82f58e6580ac89117bcdf;hp=50ca0926346309e517e0a87d0034ce217d1fce01;hb=cacb11fac1eb3f21eb55365cbff3c5e223cc7092;hpb=cd0567b4052ee24259bc6b8a9858af9d26f3de48 diff --git a/src/error.c b/src/error.c index 50ca092..46972f5 100644 --- a/src/error.c +++ b/src/error.c @@ -78,14 +78,14 @@ void psi_error_wrapper(struct psi_data *context, struct psi_token *t, int type, va_end(argv); va_start(argv, msg); - psi_debug_lock(context); - PSI_DEBUG_PRINTV(context, msg, argv); - PSI_DEBUG_PRINT(context, "\n"); - psi_debug_unlock(context); + PSI_DEBUG_LOCK(context, + PSI_DEBUG_PRINTV(context, msg, argv); + PSI_DEBUG_PRINT(context, "\n"); + ); va_end(argv); if (context) { - strlcpy(context->last_error, PG(last_error_message), + strlcpy(context->last_error, PG(last_error_message)->val, sizeof(context->last_error)); } } @@ -101,5 +101,7 @@ void psi_error(int type, const char *fn, unsigned ln, const char *msg, ...) void psi_verror(int type, const char *fn, unsigned ln, const char *msg, va_list argv) { - zend_error_cb(type, fn, ln, msg, argv); + zend_string *message = zend_vstrpprintf(0, msg, argv); + zend_error_cb(type, fn, ln, message); + zend_string_release(message); }