LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File feh-fix_pointer_arithmetics.patch of Package feh (Project X11:Utilities)

---
 src/menu.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

--- a/src/menu.c
+++ b/src/menu.c
@@ -24,6 +24,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE
 
 */
 
+#include <stdint.h>
+
 #include "feh.h"
 #include "thumbnail.h"
 #include "wallpaper.h"
@@ -906,7 +908,8 @@ void feh_menu_init_main(void)
 
 void feh_menu_init_common()
 {
-	int num_desks, i;
+	int num_desks;
+    intptr_t i;
 	char buf[30];
 	feh_menu *m;
 
@@ -950,7 +953,7 @@ void feh_menu_init_common()
 		m = feh_menu_new();
 		m->name = estrdup("TILED");
 		for (i = 0; i < num_desks; i++) {
-			snprintf(buf, sizeof(buf), "Desktop %d", i + 1);
+			snprintf(buf, sizeof(buf), "Desktop %zu", i + 1);
 			if (opt.slideshow || opt.multiwindow)
 				feh_menu_add_entry(m, buf, NULL, CB_BG_TILED,
 						i, NULL);
@@ -962,7 +965,7 @@ void feh_menu_init_common()
 		m = feh_menu_new();
 		m->name = estrdup("SCALED");
 		for (i = 0; i < num_desks; i++) {
-			snprintf(buf, sizeof(buf), "Desktop %d", i + 1);
+			snprintf(buf, sizeof(buf), "Desktop %zu", i + 1);
 
 			if (opt.slideshow || opt.multiwindow)
 				feh_menu_add_entry(m, buf, NULL, CB_BG_SCALED,
@@ -975,7 +978,7 @@ void feh_menu_init_common()
 		m = feh_menu_new();
 		m->name = estrdup("CENTERED");
 		for (i = 0; i < num_desks; i++) {
-			snprintf(buf, sizeof(buf), "Desktop %d", i + 1);
+			snprintf(buf, sizeof(buf), "Desktop %zu", i + 1);
 			if (opt.slideshow || opt.multiwindow)
 				feh_menu_add_entry(m, buf, NULL,
 						CB_BG_CENTERED, i, NULL);
@@ -987,7 +990,7 @@ void feh_menu_init_common()
 		m = feh_menu_new();
 		m->name = estrdup("FILLED");
 		for (i = 0; i < num_desks; i++) {
-			snprintf(buf, sizeof(buf), "Desktop %d", i + 1);
+			snprintf(buf, sizeof(buf), "Desktop %zu", i + 1);
 			if (opt.slideshow || opt.multiwindow)
 				feh_menu_add_entry(m, buf, NULL,
 						CB_BG_FILLED,