mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
use spprintf instead (no need to estrdup afterwards).
This commit is contained in:
parent
5c19355095
commit
2b5af600e3
@ -205,15 +205,14 @@ static int pdo_dblib_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
|
||||
struct pdo_column_data *col = &stmt->columns[colno];
|
||||
|
||||
char *fname = (char*)dbcolname(H->link, colno+1);
|
||||
char computed_buf[16];
|
||||
|
||||
if (fname && *fname) {
|
||||
col->name = estrdup(fname);
|
||||
col->namelen = strlen(col->name);
|
||||
} else {
|
||||
snprintf(computed_buf,16,"computed%d", colno);
|
||||
col->name = estrdup(computed_buf);
|
||||
col->namelen = spprintf(&col->name, NULL, "computed%d", colno);
|
||||
}
|
||||
col->maxlen = dbcollen(H->link, colno+1);
|
||||
col->namelen = strlen(col->name);
|
||||
col->param_type = PDO_PARAM_STR;
|
||||
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user