summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-03-24 22:53:22 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2010-03-24 22:53:22 +0100
commit3f7ffcb9dc191fe841a4252d6b09e9b495d15f2d (patch)
treec1596f200758c875fe6ba8e3c23607b7c2564f31
parent7c12650b8e451fabaa79ff5c11d58753448fd638 (diff)
Fix segfault related to the random slideshow jump feature
-rw-r--r--src/slideshow.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/slideshow.c b/src/slideshow.c
index 4835360..1a3ffe8 100644
--- a/src/slideshow.c
+++ b/src/slideshow.c
@@ -207,6 +207,7 @@ void slideshow_change_image(winwidget winwid, int change)
break;
case SLIDE_RAND:
current_file = feh_list_jump(filelist, current_file, FORWARD, rand() % filelist_len);
+ change = SLIDE_NEXT;
break;
case SLIDE_JUMP_FWD:
if (filelist_len < 5)
@@ -308,11 +309,12 @@ char *slideshow_create_name(feh_file * file)
int len = 0;
D_ENTER(4);
+
if (!opt.title) {
len = strlen(PACKAGE " [slideshow mode] - ") + strlen(file->filename) + 1;
s = emalloc(len);
snprintf(s, len, PACKAGE " [%d of %d] - %s",
- gib_list_num(filelist, current_file) + 1, gib_list_length(filelist), file->filename);
+ gib_list_num(filelist, current_file) + 1, gib_list_length(filelist), file->filename);
} else {
s = estrdup(feh_printf(opt.title, file));
}