From d5d305193ce527f1cc3022c406de35d9a85d4ccb Mon Sep 17 00:00:00 2001 From: hrxi Date: Sun, 1 Sep 2019 18:18:25 +0200 Subject: Fix some warnings Instances of `RegexError` are just asserted as `assert_not_reached` as they cannot really fail except for allocation failure if the given regex is valid. --- plugins/openpgp/src/util.vala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/openpgp/src/util.vala') diff --git a/plugins/openpgp/src/util.vala b/plugins/openpgp/src/util.vala index 7c42b578..d40cf6ef 100644 --- a/plugins/openpgp/src/util.vala +++ b/plugins/openpgp/src/util.vala @@ -1,6 +1,7 @@ using Gtk; using Dino.Entities; +using Xmpp.Util; namespace Dino.Plugins.OpenPgp { @@ -10,7 +11,7 @@ public static string markup_colorize_id(string s, bool is_fingerprint) { for (int i = 0; i < s.length; i += 4) { string four_chars = s.substring(i, 4).down(); - int raw = (int) four_chars.to_long(null, 16); + int raw = (int) from_hex(four_chars); uint8[] bytes = {(uint8) ((raw >> 8) & 0xff - 128), (uint8) (raw & 0xff - 128)}; Checksum checksum = new Checksum(ChecksumType.SHA1); -- cgit v1.2.3