[libc-commits] [libc] [libc] Fix copy/paste error in file.cpp (PR #150802)

via libc-commits libc-commits at lists.llvm.org
Sat Jul 26 14:37:58 PDT 2025


https://github.com/codefaber created https://github.com/llvm/llvm-project/pull/150802

Fix using wrong variable due to copy/paste error.

>From 268d890d11e06ef28c4f2f51ed3dba98cae8c2a3 Mon Sep 17 00:00:00 2001
From: codefaber <codefaber>
Date: Sun, 27 Jul 2025 00:35:42 +0300
Subject: [PATCH] [libc] Fix copy/paste error in file.cpp

---
 libc/src/__support/File/file.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/src/__support/File/file.cpp b/libc/src/__support/File/file.cpp
index 303852dbbb717..4217e73828388 100644
--- a/libc/src/__support/File/file.cpp
+++ b/libc/src/__support/File/file.cpp
@@ -123,7 +123,7 @@ FileIOResult File::write_unlocked_fbf(const uint8_t *data, size_t len) {
 
     FileIOResult result =
         platform_write(this, remainder.data(), remainder.size());
-    size_t bytes_written = buf_result.value;
+    size_t bytes_written = result.value;
 
     // If less bytes were written than expected, then an error occurred. Return
     // the number of bytes that have been written from |data|.



More information about the libc-commits mailing list