summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/imlib.c2
-rw-r--r--src/slideshow.c44
-rw-r--r--src/thumbnail.c4
3 files changed, 25 insertions, 25 deletions
diff --git a/src/imlib.c b/src/imlib.c
index 42d9711..2047c63 100644
--- a/src/imlib.c
+++ b/src/imlib.c
@@ -227,7 +227,7 @@ void feh_imlib_print_load_error(char *file, winwidget w, Imlib_Load_Error err)
int feh_load_image(Imlib_Image * im, feh_file * file)
{
- Imlib_Load_Error err;
+ Imlib_Load_Error err = IMLIB_LOAD_ERROR_NONE;
enum { SRC_IMLIB, SRC_HTTP, SRC_MAGICK } image_source =
SRC_IMLIB;
char *tmpname = NULL;
diff --git a/src/slideshow.c b/src/slideshow.c
index 19fb773..69d8db2 100644
--- a/src/slideshow.c
+++ b/src/slideshow.c
@@ -478,109 +478,109 @@ char *feh_printf(char *str, feh_file * file, winwidget winwid)
switch (*c) {
case 'f':
if (file)
- strncat(ret, file->filename, sizeof(ret) - strlen(ret));
+ strncat(ret, file->filename, sizeof(ret) - strlen(ret) - 1);
break;
case 'F':
if (file)
- strncat(ret, shell_escape(file->filename), sizeof(ret) - strlen(ret));
+ strncat(ret, shell_escape(file->filename), sizeof(ret) - strlen(ret) - 1);
break;
case 'h':
if (file && (file->info || !feh_file_info_load(file, NULL))) {
snprintf(buf, sizeof(buf), "%d", file->info->height);
- strncat(ret, buf, sizeof(ret) - strlen(ret));
+ strncat(ret, buf, sizeof(ret) - strlen(ret) - 1);
}
break;
case 'l':
snprintf(buf, sizeof(buf), "%d", gib_list_length(filelist));
- strncat(ret, buf, sizeof(ret) - strlen(ret));
+ strncat(ret, buf, sizeof(ret) - strlen(ret) - 1);
break;
case 'L':
if (filelist_tmppath != NULL) {
- strncat(ret, filelist_tmppath, sizeof(ret) - strlen(ret));
+ strncat(ret, filelist_tmppath, sizeof(ret) - strlen(ret) - 1);
} else {
filelist_tmppath = feh_unique_filename("/tmp/","filelist");
feh_write_filelist(filelist, filelist_tmppath);
- strncat(ret, filelist_tmppath, sizeof(ret) - strlen(ret));
+ strncat(ret, filelist_tmppath, sizeof(ret) - strlen(ret) - 1);
}
break;
case 'm':
- strncat(ret, mode, sizeof(ret) - strlen(ret));
+ strncat(ret, mode, sizeof(ret) - strlen(ret) - 1);
break;
case 'n':
if (file)
- strncat(ret, file->name, sizeof(ret) - strlen(ret));
+ strncat(ret, file->name, sizeof(ret) - strlen(ret) - 1);
break;
case 'N':
if (file)
- strncat(ret, shell_escape(file->name), sizeof(ret) - strlen(ret));
+ strncat(ret, shell_escape(file->name), sizeof(ret) - strlen(ret) - 1);
break;
case 'o':
if (winwid) {
snprintf(buf, sizeof(buf), "%d,%d", winwid->im_x,
winwid->im_y);
- strncat(ret, buf, sizeof(ret) - strlen(ret));
+ strncat(ret, buf, sizeof(ret) - strlen(ret) - 1);
}
break;
case 'p':
if (file && (file->info || !feh_file_info_load(file, NULL))) {
snprintf(buf, sizeof(buf), "%d", file->info->pixels);
- strncat(ret, buf, sizeof(ret) - strlen(ret));
+ strncat(ret, buf, sizeof(ret) - strlen(ret) - 1);
}
break;
case 'P':
if (file && (file->info || !feh_file_info_load(file, NULL))) {
- strncat(ret, format_size(file->info->pixels), sizeof(ret) - strlen(ret));
+ strncat(ret, format_size(file->info->pixels), sizeof(ret) - strlen(ret) - 1);
}
break;
case 'r':
if (winwid) {
snprintf(buf, sizeof(buf), "%.1f", winwid->im_angle);
- strncat(ret, buf, sizeof(ret) - strlen(ret));
+ strncat(ret, buf, sizeof(ret) - strlen(ret) - 1);
}
break;
case 's':
if (file && (file->info || !feh_file_info_load(file, NULL))) {
snprintf(buf, sizeof(buf), "%d", file->info->size);
- strncat(ret, buf, sizeof(ret) - strlen(ret));
+ strncat(ret, buf, sizeof(ret) - strlen(ret) - 1);
}
break;
case 'S':
if (file && (file->info || !feh_file_info_load(file, NULL))) {
- strncat(ret, format_size(file->info->size), sizeof(ret) - strlen(ret));
+ strncat(ret, format_size(file->info->size), sizeof(ret) - strlen(ret) - 1);
}
break;
case 't':
if (file && (file->info || !feh_file_info_load(file, NULL))) {
- strncat(ret, file->info->format, sizeof(ret) - strlen(ret));
+ strncat(ret, file->info->format, sizeof(ret) - strlen(ret) - 1);
}
break;
case 'u':
snprintf(buf, sizeof(buf), "%d",
current_file != NULL ? gib_list_num(filelist, current_file)
+ 1 : 0);
- strncat(ret, buf, sizeof(ret) - strlen(ret));
+ strncat(ret, buf, sizeof(ret) - strlen(ret) - 1);
break;
case 'v':
- strncat(ret, VERSION, sizeof(ret) - strlen(ret));
+ strncat(ret, VERSION, sizeof(ret) - strlen(ret) - 1);
break;
case 'V':
snprintf(buf, sizeof(buf), "%d", getpid());
- strncat(ret, buf, sizeof(ret) - strlen(ret));
+ strncat(ret, buf, sizeof(ret) - strlen(ret) - 1);
break;
case 'w':
if (file && (file->info || !feh_file_info_load(file, NULL))) {
snprintf(buf, sizeof(buf), "%d", file->info->width);
- strncat(ret, buf, sizeof(ret) - strlen(ret));
+ strncat(ret, buf, sizeof(ret) - strlen(ret) - 1);
}
break;
case 'z':
if (winwid) {
snprintf(buf, sizeof(buf), "%.2f", winwid->zoom);
- strncat(ret, buf, sizeof(ret) - strlen(ret));
+ strncat(ret, buf, sizeof(ret) - strlen(ret) - 1);
}
break;
case '%':
- strncat(ret, "%", sizeof(ret) - strlen(ret));
+ strncat(ret, "%", sizeof(ret) - strlen(ret) - 1);
break;
default:
weprintf("Unrecognized format specifier %%%c", *c);
diff --git a/src/thumbnail.c b/src/thumbnail.c
index a77152a..f2c8476 100644
--- a/src/thumbnail.c
+++ b/src/thumbnail.c
@@ -829,13 +829,13 @@ void feh_thumbnail_select_prev(winwidget winwid, int jump)
}
}
-inline void feh_thumbnail_show_selected()
+void feh_thumbnail_show_selected()
{
if (td.selected && td.selected->file)
feh_thumbnail_show_fullsize(td.selected->file);
}
-inline feh_file* feh_thumbnail_get_selected_file()
+feh_file* feh_thumbnail_get_selected_file()
{
if (td.selected)
return td.selected->file;