{
/* char/binary data */
len = strlen(p);
+
+ /* Note that at this point we don't know if we've been called just
+ * to get the length of the output. If it's unicode, then we better
+ * adjust to bytes now, so we don't return a buffer size that's too
+ * small.
+ */
+ if (conn->unicode)
+ len *= WCLEN;
if (rgbInfoValue)
{
if (len >= cbInfoValueMax)
{
result = SQL_SUCCESS_WITH_INFO;
- CC_set_error(conn, CONN_TRUNCATED, "The buffer was too small for tthe InfoValue.");
+ CC_set_error(conn, CONN_TRUNCATED, "The buffer was too small for the InfoValue.");
}
}
}
/* char/binary data */
len = strlen(p);
+ /* Note that at this point we don't know if we've been called just
+ * to get the length of the output. If it's unicode, then we better
+ * adjust to bytes now, so we don't return a buffer size that's too
+ * small.
+ */
+ if (conn->unicode)
+ len *= WCLEN;
+
if (rgbInfoValue)
{
#ifdef UNICODE_SUPPORT
if (len >= cbInfoValueMax)
{
result = SQL_SUCCESS_WITH_INFO;
- CC_set_error(conn, CONN_TRUNCATED, "The buffer was too small for tthe InfoValue.");
+ CC_set_error(conn, CONN_TRUNCATED, "The buffer was too small for the InfoValue.");
}
}
}