Skip to content

Commit 6202032

Browse files
committed
Avoid compiler warnings about uninitialized values
Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 7b7b35d commit 6202032

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/main.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ Napi::Number _keyToggle(const Napi::CallbackInfo &info)
496496
MMKeyFlags flags = MOD_NONE;
497497
MMKeyCode key;
498498

499-
bool down;
499+
bool down = false;
500500

501501
//Get arguments from JavaScript.
502502
std::string keyName = info[0].As<Napi::String>();

src/win32/keypress.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ void typeString(const char *str)
167167
c3 = (*str++) & 0x3F;
168168
n = ((c & 0x07) << 18) | (c1 << 12) | (c2 << 6) | c3;
169169
}
170+
else
171+
continue; /* ignore invalid UTF-8 */
170172

171173
toggleUniKey(n, true);
172174
toggleUniKey(n, false);

0 commit comments

Comments
 (0)