kou commented on code in PR #13203:
URL: https://github.com/apache/arrow/pull/13203#discussion_r878765662
##########
cpp/src/arrow/util/io_util.cc:
##########
@@ -203,16 +203,26 @@ std::string ErrnoMessage(int errnum) { return
std::strerror(errnum); }
#if _WIN32
std::string WinErrorMessage(int errnum) {
- char buf[1024];
- auto nchars = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL, errnum, 0, buf, sizeof(buf), NULL);
- if (nchars == 0) {
+#define MAX_N_CHARACTERS 1024
+#define MAX_N_UTF8_BYTES 4096
Review Comment:
Yes. I should have used `constexpr`.
--
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]