elastic / elasticsearch-sql-odbc

ODBC driver for Elasticsearch SQL
Other
0 stars 30 forks source link

SQLDriverConnect: fix handling of output connection string buffer #194

Closed bpintea closed 5 years ago

bpintea commented 5 years ago

If the application provides an output buffer for the constructed connection string, the driver will currently return an error and thus fail the connection. The correct handling is however to apply truncation but return the number of characters available without truncation.

This PR works around swprintf() returning an error code, but otherwise correctly 0-terminating the destination buffer and not setting the errno.