summaryrefslogtreecommitdiff
path: root/fastboot/socket_mock.cpp
diff options
context:
space:
mode:
authorSpencer Low <CompareAndSwap@gmail.com>2015-11-15 16:29:36 -0800
committerSpencer Low <CompareAndSwap@gmail.com>2016-01-28 16:31:28 -0800
commita30b79a2d9af3850da23b62703bf3b76db076ab9 (patch)
tree7cf773c2d80bf09a8c0e03bc4f6f671daf0c31f1 /fastboot/socket_mock.cpp
parent53529ecacdffbbffb5c9fbc4ab38103703dde32e (diff)
adb: win32: handle incomplete UTF-8 in console output, other fixes
Previously, the various adb_printf, adb_fwrite, etc. functions did not correctly handle the case of the passed buffer ending with an incomplete UTF-8 sequence. This is fixed by buffering up incomplete UTF-8 sequences in g_console_output_buffer (protected by the mutex g_console_output_buffer) and outputting it later once the full sequence is available. A unittest for the main worker function, ParseCompleteUTF8(), was added to adb_test. Other fixes: - Fix the return value of number-of-chars written to be number of UTF-8 bytes instead of number of UTF-16 characters. - Don't overwrite errno in success cases of various adb_printf, etc. functions. This might be excessive, but might be useful in the case when these functions are used for debugging/tracing. - Add missing UTF-8 stdio functions that aren't currently used by adb, but might be in the future: vprintf, putc, putchar, puts. - stdin_raw_init: If we can't get the console handle, don't call SetConsoleMode(). Not a big deal, but this will prevent erroneous trace output. Change-Id: I8730e8af92882c42b884ad921b39a17b54465085 Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
Diffstat (limited to 'fastboot/socket_mock.cpp')
0 files changed, 0 insertions, 0 deletions