From 04f8c1bda859b55f2f56f2ad5e2ca6e469f82e61 Mon Sep 17 00:00:00 2001 From: SakiTakamachi Date: Wed, 22 Nov 2023 19:48:10 +0900 Subject: [PATCH] Optimized error handling --- ext/pdo_firebird/firebird_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c index 97245c2940a..bb9eb29ee91 100644 --- a/ext/pdo_firebird/firebird_driver.c +++ b/ext/pdo_firebird/firebird_driver.c @@ -844,7 +844,7 @@ static int php_firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const zend_string *sq /* Firebird allows SQL statements up to 64k, so bail if it doesn't fit */ if (ZSTR_LEN(sql) > 65536) { - strcpy(dbh->error_code, "01004"); + php_firebird_error_with_info(dbh, "01004", strlen("01004"), NULL, 0); return 0; } @@ -869,7 +869,7 @@ static int php_firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const zend_string *sq new_sql = emalloc(ZSTR_LEN(sql)+1); new_sql[0] = '\0'; if (!php_firebird_preprocess(sql, new_sql, named_params)) { - strcpy(dbh->error_code, "07000"); + php_firebird_error_with_info(dbh, "07000", strlen("07000"), NULL, 0); efree(new_sql); return 0; }