From 73d9dddc28c8856a64dcec6c3a08b8a246554817 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 9 Dec 2022 12:42:57 +0100 Subject: 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 --- lib/bluetooth-pairing-dialog.c | 2 ++ 1 file changed, 2 insertions(+) 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++) -- cgit v1.2.1