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: Pavel Borzenkov <pavel.borzenkov@gmail.com>
Signed-off-by: Sebastian Ramacher <s.ramacher@gmx.at>
This commit is contained in:
Pavel Borzenkov 2011-10-19 02:24:53 -04:00 committed by Sebastian Ramacher
parent 10fbf29125
commit 721d566881
2 changed files with 6 additions and 2 deletions

View file

@ -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);

View file

@ -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: