isapego commented on a change in pull request #9341:
URL: https://github.com/apache/ignite/pull/9341#discussion_r691289035
##########
File path: modules/platforms/cpp/odbc-test/include/test_utils.h
##########
@@ -57,6 +57,27 @@
return; \
}
+/**
+ * Copy std::string to buffer.
+ *
+ * @param dst Destination buffer.
+ * @param src Source std::string.
+ * @param n Copy at most n bytes of src.
+ */
+inline void CopyStringToBuffer(char *dst, const std::string& src, size_t n) {
+ if (n == 0) {
+ return;
+ }
+
+ size_t size = std::min(src.size(), n - 1);
+
+ if (size != n) {
Review comment:
This check is not needed actually. It can never be `n`, as it at most `n
- 1`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]