Skip to content

Commit

Permalink
src: fix use of uninitialized variable
Browse files Browse the repository at this point in the history
Variable was uninitialized in 72547fe
Initialize the variable and add a static_check

PR-URL: #9281
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
jasnell authored and evanlucas committed Nov 3, 2016
1 parent 6c9e4fd commit 5ab172e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/node_i18n.cc
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,9 @@ static void GetStringWidth(const FunctionCallbackInfo<Value>& args) {
TwoByteValue value(env->isolate(), args[0]);
// reinterpret_cast is required by windows to compile
UChar* str = reinterpret_cast<UChar*>(*value);
UChar32 c;
static_assert(sizeof(*str) == sizeof(**value),
"sizeof(*str) == sizeof(**value)");
UChar32 c = 0;
UChar32 p;
size_t n = 0;
uint32_t width = 0;
Expand Down

0 comments on commit 5ab172e

Please sign in to comment.