From 88e7c7afe81f6c4344b1e4674e2296ee28ccc442 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 9 Mar 2020 21:15:27 +0100 Subject: [PATCH] Simplify --- zathura/marks.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/zathura/marks.c b/zathura/marks.c index 66f3ff7..b8ea482 100644 --- a/zathura/marks.c +++ b/zathura/marks.c @@ -122,20 +122,15 @@ cmd_marks_add(girara_session_t* session, girara_list_t* argument_list) return false; } - char* key_string = girara_list_nth(argument_list, 0); + const char* key_string = girara_list_nth(argument_list, 0); - if (key_string == NULL) { + if (key_string == NULL || strlen(key_string) != 1) { return false; } - if (strlen(key_string) != 1) { - return false; - } - - char key = key_string[0]; - - if (((key >= 0x41 && key <= 0x5A) || (key >= - 0x61 && key <= 0x7A)) == false) { + const char key = key_string[0]; + if (((key >= 0x41 && key <= 0x5A) || + (key >= 0x61 && key <= 0x7A)) == false) { return false; }