Skip to content

Commit 267ddff

Browse files
RaisinTentargos
authored andcommitted
src: fix compiler warnings in node_buffer.cc
The variables could be initialized to `0` to avoid the warnings from `-Wmaybe-uninitialized`. Fixes: #38718 PR-URL: #38722 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
1 parent 2ec28e4 commit 267ddff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/node_buffer.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ void Fill(const FunctionCallbackInfo<Value>& args) {
557557
THROW_AND_RETURN_UNLESS_BUFFER(env, args[0]);
558558
SPREAD_BUFFER_ARG(args[0], ts_obj);
559559

560-
size_t start;
560+
size_t start = 0;
561561
THROW_AND_RETURN_IF_OOB(ParseArrayIndex(env, args[2], 0, &start));
562562
size_t end;
563563
THROW_AND_RETURN_IF_OOB(ParseArrayIndex(env, args[3], 0, &end));
@@ -658,8 +658,8 @@ void StringWrite(const FunctionCallbackInfo<Value>& args) {
658658

659659
Local<String> str = args[0]->ToString(env->context()).ToLocalChecked();
660660

661-
size_t offset;
662-
size_t max_length;
661+
size_t offset = 0;
662+
size_t max_length = 0;
663663

664664
THROW_AND_RETURN_IF_OOB(ParseArrayIndex(env, args[1], 0, &offset));
665665
if (offset > ts_obj_length) {

0 commit comments

Comments
 (0)