diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-09-29 16:34:37 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-09-29 16:34:37 +0200 |
commit | 7281c129a9bf11594179a768aa34213fe69e98ed (patch) | |
tree | a67bf0e25018c8a79096f499246e279fcc07dd19 /src/slideshow.c | |
parent | 88c1d182b11c442cf8c0930e682b7ad571e9212d (diff) |
feh_printf: Check feh_file_info_load return status
Diffstat (limited to 'src/slideshow.c')
-rw-r--r-- | src/slideshow.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/slideshow.c b/src/slideshow.c index e6ffb56..52ef4b3 100644 --- a/src/slideshow.c +++ b/src/slideshow.c @@ -402,41 +402,31 @@ char *feh_printf(char *str, feh_file * file) strcat(ret, file->name); break; case 'w': - if (file) { - if (!file->info) - feh_file_info_load(file, NULL); + if (file && (file->info || !feh_file_info_load(file, NULL))) { snprintf(buf, sizeof(buf), "%d", file->info->width); strcat(ret, buf); } break; case 'h': - if (file) { - if (!file->info) - feh_file_info_load(file, NULL); + if (file && (file->info || !feh_file_info_load(file, NULL))) { snprintf(buf, sizeof(buf), "%d", file->info->height); strcat(ret, buf); } break; case 's': - if (file) { - if (!file->info) - feh_file_info_load(file, NULL); + if (file && (file->info || !feh_file_info_load(file, NULL))) { snprintf(buf, sizeof(buf), "%d", file->info->size); strcat(ret, buf); } break; case 'p': - if (file) { - if (!file->info) - feh_file_info_load(file, NULL); + if (file && (file->info || !feh_file_info_load(file, NULL))) { snprintf(buf, sizeof(buf), "%d", file->info->pixels); strcat(ret, buf); } break; case 't': - if (file) { - if (!file->info) - feh_file_info_load(file, NULL); + if (file && (file->info || !feh_file_info_load(file, NULL))) { strcat(ret, file->info->format); } break; |