Commit 721d5668 authored by Pavel Borzenkov's avatar Pavel Borzenkov Committed by Sebastian Ramacher

Fix warnings reported by Clang Analyzer

Clang Analyzer reports:

shortcuts.c:238:11: warning: Value stored to 'new_value' during its initialization is never read
  gdouble new_value   = value;
          ^             ~~~~~

completion.c:163:50: warning: Null pointer passed as an argument to a 'nonnull' parameter
    if (input_length <= strlen(bookmark->id) && !strncmp(input, bookmark->id, input_length)) {
                                                 ^       ~~~~~
Signed-off-by: default avatarPavel Borzenkov <pavel.borzenkov@gmail.com>
Signed-off-by: default avatarSebastian Ramacher <s.ramacher@gmx.at>
parent 10fbf291
......@@ -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);
......
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment