[libc-commits] [libc] [libc] Fixed StringConverter Error Edge Case (PR #149356)
via libc-commits
libc-commits at lists.llvm.org
Thu Jul 17 09:52:33 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions h,cpp -- libc/src/__support/wchar/string_converter.h libc/test/src/__support/wchar/string_converter_test.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libc/src/__support/wchar/string_converter.h b/libc/src/__support/wchar/string_converter.h
index b4e6fde95..869ebdfc8 100644
--- a/libc/src/__support/wchar/string_converter.h
+++ b/libc/src/__support/wchar/string_converter.h
@@ -63,7 +63,7 @@ public:
auto src_elements_read = pushFullCharacter();
if (!src_elements_read.has_value())
return Error(src_elements_read.error());
-
+
if (cr.sizeAsUTF32() > num_to_write) {
cr.clear();
return Error(-1);
@@ -84,7 +84,7 @@ public:
ErrorOr<char8_t> popUTF8() {
if (num_to_write == 0)
return Error(-1);
-
+
if (cr.isEmpty() || src_idx == 0) {
auto src_elements_read = pushFullCharacter();
if (!src_elements_read.has_value())
``````````
</details>
https://github.com/llvm/llvm-project/pull/149356
More information about the libc-commits
mailing list