summaryrefslogtreecommitdiff
path: root/app-editors/qhexedit2/files/qhexedit2-0.8.9-fix-crash.patch
diff options
context:
space:
mode:
Diffstat (limited to 'app-editors/qhexedit2/files/qhexedit2-0.8.9-fix-crash.patch')
-rw-r--r--app-editors/qhexedit2/files/qhexedit2-0.8.9-fix-crash.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/app-editors/qhexedit2/files/qhexedit2-0.8.9-fix-crash.patch b/app-editors/qhexedit2/files/qhexedit2-0.8.9-fix-crash.patch
new file mode 100644
index 000000000000..9c3099b06d28
--- /dev/null
+++ b/app-editors/qhexedit2/files/qhexedit2-0.8.9-fix-crash.patch
@@ -0,0 +1,37 @@
+https://github.com/Simsys/qhexedit2/pull/139
+From d314aab25eeab0db131fc87f20daf7c4ad587ee2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=E8=AF=B7=E5=8F=AB=E6=88=91=E8=88=B9=E9=95=BF?=
+ <38233142+thinkSJ@users.noreply.github.com>
+Date: Sat, 13 Nov 2021 18:35:25 +0800
+Subject: [PATCH] Update qhexedit.cpp
+
+crashed when press ctrl alt keys....
+---
+ src/qhexedit.cpp | 14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+diff --git a/src/qhexedit.cpp b/src/qhexedit.cpp
+index d7e532c..4137192 100644
+--- a/src/qhexedit.cpp
++++ b/src/qhexedit.cpp
+@@ -766,11 +766,15 @@ void QHexEdit::keyPressEvent(QKeyEvent *event)
+ (QApplication::keyboardModifiers() == Qt::GroupSwitchModifier))
+ {
+ /* Hex and ascii input */
+- int key;
+- if (_editAreaIsAscii)
+- key = (uchar)event->text().at(0).toLatin1();
+- else
+- key = int(event->text().at(0).toLower().toLatin1());
++ int key = 0;
++ QString text = event->text();
++ if (!text.isEmpty())
++ {
++ if (_editAreaIsAscii)
++ key = (uchar)text.at(0).toLatin1();
++ else
++ key = int(text.at(0).toLower().toLatin1());
++ }
+
+ if ((((key >= '0' && key <= '9') || (key >= 'a' && key <= 'f')) && _editAreaIsAscii == false)
+ || (key >= ' ' && _editAreaIsAscii))