WillAyd commented on code in PR #587:
URL: https://github.com/apache/arrow-adbc/pull/587#discussion_r1179855463
##########
c/driver/common/utils.c:
##########
@@ -138,11 +138,11 @@ int StringBuilderAppend(struct StringBuilder* builder,
const char* fmt, ...) {
va_end(argptr);
if (n < 0) {
- return -1;
+ return errno;
Review Comment:
Hmm really? Trying to find a definitive list of library calls that do or
don't set errno without luck, but as far as I can tell in POSIX (through
clicking all the references in
https://pubs.opengroup.org/onlinepubs/7908799/xsh/vsprintf.html) this has
similar error handling to fputc which does explicitly set errno
https://pubs.opengroup.org/onlinepubs/7908799/xsh/fputc.html
Microsoft documentation is thankfully more explicit:
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/vsnprintf-vsnprintf-vsnprintf-l-vsnwprintf-vsnwprintf-l?view=msvc-170#return-value
--
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]