summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2022-12-09 12:42:57 +0100
committerBastien Nocera <hadess@hadess.net>2022-12-09 13:49:49 +0100
commit73d9dddc28c8856a64dcec6c3a08b8a246554817 (patch)
tree6b2d413533f71a03cdd00c84e3086250744c1f7c
parentb055c6f1a06cf7a07db53b172254c43ba99d8fef (diff)
downloadgnome-bluetooth-73d9dddc28c8856a64dcec6c3a08b8a246554817.tar.gz
pairing-dialog: Fix pairing with keyboard with typing notification
The invisible character we fetch from an entry might be zero if it isn't set, for example when the entry isn't setup to hide text. This would result in the passkey that's displayed being truncated as the invisible character would be a nul terminator. Make sure we have a valid invisible character, so the passkey doesn't disappear after the first typed character when pairing a keyboard with typing notification. Closes: #125
-rw-r--r--lib/bluetooth-pairing-dialog.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/bluetooth-pairing-dialog.c b/lib/bluetooth-pairing-dialog.c
index bf427da8..ab70d181 100644
--- a/lib/bluetooth-pairing-dialog.c
+++ b/lib/bluetooth-pairing-dialog.c
@@ -195,6 +195,8 @@ bluetooth_pairing_dialog_set_pin_entered (BluetoothPairingDialog *self,
guint i;
invisible = gtk_entry_get_invisible_char (GTK_ENTRY (priv->entry_pin));
+ if (invisible == 0)
+ invisible = '*';
str = g_string_new (NULL);
for (i = 0; i < entered; i++)