[go: nahoru, domu]

Skip to content

Commit

Permalink
Properly initialize displaysize
Browse files Browse the repository at this point in the history
From Microsoft's `SQLColAttribute()` documentation[1]:

| Please note that some drivers may only write the lower 32-bit or
| 16-bit of a buffer and leave the higher-order bit unchanged.
| Therefore, applications should initialize the value to 0 before
| calling this function.

[1] <https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlcolattribute-function>
  • Loading branch information
cmb69 committed Jun 24, 2020
1 parent 16fe64d commit 38177dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/pdo_odbc/odbc_stmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno)
RETCODE rc;
SWORD colnamelen;
SQLULEN colsize;
SQLLEN displaysize;
SQLLEN displaysize = 0;

rc = SQLDescribeCol(S->stmt, colno+1, S->cols[colno].colname,
sizeof(S->cols[colno].colname)-1, &colnamelen,
Expand Down

0 comments on commit 38177dc

Please sign in to comment.