Skip to content

Commit 04f8c1b

Browse files
SakiTakamachiGirgias
authored andcommitted
Optimized error handling
1 parent 54b12bc commit 04f8c1b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/pdo_firebird/firebird_driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ static int php_firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const zend_string *sq
844844

845845
/* Firebird allows SQL statements up to 64k, so bail if it doesn't fit */
846846
if (ZSTR_LEN(sql) > 65536) {
847-
strcpy(dbh->error_code, "01004");
847+
php_firebird_error_with_info(dbh, "01004", strlen("01004"), NULL, 0);
848848
return 0;
849849
}
850850

@@ -869,7 +869,7 @@ static int php_firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const zend_string *sq
869869
new_sql = emalloc(ZSTR_LEN(sql)+1);
870870
new_sql[0] = '\0';
871871
if (!php_firebird_preprocess(sql, new_sql, named_params)) {
872-
strcpy(dbh->error_code, "07000");
872+
php_firebird_error_with_info(dbh, "07000", strlen("07000"), NULL, 0);
873873
efree(new_sql);
874874
return 0;
875875
}

0 commit comments

Comments
 (0)