Skip to content

Commit 93e58ab

Browse files
authored
Merge pull request #5 from sysprog21/fix-null-character
Handle NULL character as input properly
2 parents 3dd1b46 + d546545 commit 93e58ab

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

menuconfig.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,6 +1769,9 @@ def edit_width():
17691769
_safe_curs_set(0)
17701770
return None
17711771

1772+
elif c == "\0": # \0 = NUL, ignore
1773+
pass
1774+
17721775
else:
17731776
s, i, hscroll = _edit_text(c, s, i, hscroll, edit_width())
17741777

@@ -2208,6 +2211,9 @@ def select_prev_match():
22082211
elif c == curses.KEY_HOME:
22092212
sel_node_i = scroll = 0
22102213

2214+
elif c == "\0": # \0 = NUL, ignore
2215+
pass
2216+
22112217
else:
22122218
s, s_i, hscroll = _edit_text(c, s, s_i, hscroll,
22132219
_width(edit_box) - 2)

0 commit comments

Comments
 (0)