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 <[email protected]>
---
completion.c | 6 +++++-
shortcuts.c | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
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:
--
1.7.0.4
_______________________________________________
zathura mailing list
[email protected]
http://lists.pwmt.org/mailman/listinfo/zathura