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;