diff --git a/src/module_wrap.cc b/src/module_wrap.cc index 4b60b6b8e4bb0e..816c68d55d16ce 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -433,16 +433,15 @@ std::string ReadFile(uv_file file) { uv_fs_t req; char buffer_memory[4096]; uv_buf_t buf = uv_buf_init(buffer_memory, sizeof(buffer_memory)); - int r; do { - r = uv_fs_read(uv_default_loop(), - &req, - file, - &buf, - 1, - contents.length(), // offset - nullptr); + const int r = uv_fs_read(uv_default_loop(), + &req, + file, + &buf, + 1, + contents.length(), // offset + nullptr); uv_fs_req_cleanup(&req); if (r <= 0)