1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

ext/pdo_firebird: Fix label follow by declaration (#17229)

A label should be followed by a statement and not a declaration, else old gcc gives the following error: a label can only be part of a statement and a declaration is not a statement

To fix this we wrap the code in the switch case block in braces.
This commit is contained in:
Shivam Mathur
2024-12-21 16:56:53 +05:30
committed by GitHub
parent 1fff0c05b7
commit b1220da496

View File

@@ -886,7 +886,7 @@ static int pdo_firebird_stmt_set_attribute(pdo_stmt_t *stmt, zend_long attr, zva
switch (attr) {
default:
return 0;
case PDO_ATTR_CURSOR_NAME:
case PDO_ATTR_CURSOR_NAME: {
zend_string *str_val = zval_try_get_string(val);
if (str_val == NULL) {
return 0;
@@ -907,6 +907,7 @@ static int pdo_firebird_stmt_set_attribute(pdo_stmt_t *stmt, zend_long attr, zva
memcpy(S->name, ZSTR_VAL(str_val), ZSTR_LEN(str_val) + 1);
zend_string_release(str_val);
break;
}
}
return 1;
}