Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9ca5c0e

Browse filesBrowse files
RaisinTendanielleadams
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 <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
1 parent c7a5857 commit 9ca5c0e
Copy full SHA for 9ca5c0e

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Open diff view settings
Collapse file

‎src/node_buffer.cc‎

Copy file name to clipboardExpand all lines: src/node_buffer.cc
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ void Fill(const FunctionCallbackInfo<Value>& args) {
567567
THROW_AND_RETURN_UNLESS_BUFFER(env, args[0]);
568568
SPREAD_BUFFER_ARG(args[0], ts_obj);
569569

570-
size_t start;
570+
size_t start = 0;
571571
THROW_AND_RETURN_IF_OOB(ParseArrayIndex(env, args[2], 0, &start));
572572
size_t end;
573573
THROW_AND_RETURN_IF_OOB(ParseArrayIndex(env, args[3], 0, &end));
@@ -668,8 +668,8 @@ void StringWrite(const FunctionCallbackInfo<Value>& args) {
668668

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

671-
size_t offset;
672-
size_t max_length;
671+
size_t offset = 0;
672+
size_t max_length = 0;
673673

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.