diff --git a/completion.c b/completion.c index 5a545d4..a3f41a7 100644 --- a/completion.c +++ b/completion.c @@ -158,7 +158,11 @@ cc_bookmarks(girara_session_t* session, const char* input) goto error_free; } - const size_t input_length = input ? strlen(input) : 0; + if (!input) { + goto error_free; + } + + const size_t input_length = strlen(input); GIRARA_LIST_FOREACH(zathura->bookmarks.bookmarks, zathura_bookmark_t*, iter, bookmark) if (input_length <= strlen(bookmark->id) && !strncmp(input, bookmark->id, input_length)) { gchar* paged = g_strdup_printf("Page %d", bookmark->page); diff --git a/shortcuts.c b/shortcuts.c index 0c70718..cfdd7b3 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -235,7 +235,7 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument, unsigned int gdouble value = gtk_adjustment_get_value(adjustment); gdouble max = gtk_adjustment_get_upper(adjustment) - view_size; gdouble scroll_step = 40; - gdouble new_value = value; + gdouble new_value; switch(argument->n) { case FULL_UP: