llvm-project/libcxx
Thomas Anderson d4d824a861 [libc++] Fix return value of snprintf_l() on Windows when buffer is too small
When the output buffer is too small to contain the output, `vsnprintf()`
fills the buffer and returns the number of characters that __would have__
been written if the buffer was sufficiently large.

`_vnsprintf_s()` on the other hand fills the buffer and returns -1 when this
happens.  We want the former behavior, but we also want to be able to
pass in a locale to prevent having to call `setlocale()`.

`__stdio_common_vsprintf()` is the only function general enough to get
the behavior we want.

Differential Revision: https://reviews.llvm.org/D59727

llvm-svn: 357024
2019-03-26 19:51:30 +00:00
..
benchmarks Add relational benchmark against a string constant. 2019-03-21 16:06:15 +00:00
cmake [libc++][CMake] Clean up some of the libc++ re-exporting logic 2019-03-20 18:16:24 +00:00
docs [libc++] Re-document how to use <filesystem> with various versions of libc++ 2019-03-21 16:21:09 +00:00
fuzzing Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
include Revert "[coroutines] Add std::experimental::task<T> type" 2019-03-26 19:50:46 +00:00
lib [libc++][CMake] Allow merging libc++abi.a into libc++ even on Apple platforms 2019-03-25 14:56:29 +00:00
src [libc++] Fix return value of snprintf_l() on Windows when buffer is too small 2019-03-26 19:51:30 +00:00
test Revert "[coroutines] Add std::experimental::task<T> type" 2019-03-26 19:50:46 +00:00
utils [libc++][CMake] Allow merging libc++abi.a into libc++ even on Apple platforms 2019-03-25 14:56:29 +00:00
www [libc++][CMake] Clean up some of the libc++ re-exporting logic 2019-03-20 18:16:24 +00:00
.arcconfig [libcxx] Set up .arcconfig to point to new Diffusion CXX repository 2017-12-04 17:55:28 +00:00
.clang-format Make clang-format use C++03 syntax 2017-04-15 02:45:43 +00:00
.gitignore Implement N4606 optional 2016-10-12 07:46:20 +00:00
CMakeLists.txt [libc++][CMake] Allow merging libc++abi.a into libc++ even on Apple platforms 2019-03-25 14:56:29 +00:00
CREDITS.TXT Try again, this time with the correct address 2017-12-29 19:26:53 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
NOTES.TXT Reland "Use custom command and target to install libc++ headers" 2018-06-12 03:10:02 +00:00
TODO.TXT Add list of filesystem NB comments to TODO.TXT so they can be tracked separately 2017-03-06 21:23:36 +00:00
appveyor-reqs-install.cmd Update LLVM version used on Appveyor bot, remove MSVC 2015 bot 2018-10-30 21:23:31 +00:00
appveyor.yml Update LLVM version used on Appveyor bot, remove MSVC 2015 bot 2018-10-30 21:23:31 +00:00