From 84d0a210d8738937ebcfdb18de2b2ddba57ddd7f Mon Sep 17 00:00:00 2001 From: Siim Meerits Date: Mon, 3 Aug 2020 01:15:17 +0300 Subject: [PATCH] Fix fuji camlib compilation warnings. fuji.c: Resolve signed-unsigned compare issue. The variable 'i' is used in 'for' loop as array index counter. It is already used as unsigned integer in compares and a negative value would cause a segfault. library.c: Resolve signed-unsigned compare issue. The variable 'i' is used in 'for' loop in a very simple way and is compared to an unsigned number already. --- camlibs/fuji/fuji.c | 2 +- camlibs/fuji/library.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/camlibs/fuji/fuji.c b/camlibs/fuji/fuji.c index 21dc7cf6f..eafb6d34c 100644 --- a/camlibs/fuji/fuji.c +++ b/camlibs/fuji/fuji.c @@ -178,7 +178,7 @@ fuji_recv (Camera *camera, unsigned char *buf, unsigned int *buf_len, unsigned char *last, GPContext *context) { unsigned char b[1024], check = 0; - int i; + unsigned int i; /* * Read the header. The checksum covers all bytes between diff --git a/camlibs/fuji/library.c b/camlibs/fuji/library.c index 1145dd096..60bf94069 100644 --- a/camlibs/fuji/library.c +++ b/camlibs/fuji/library.c @@ -165,7 +165,7 @@ file_list_func (CameraFilesystem *fs, const char *folder, CameraList *list, void *data, GPContext *context) { Camera *camera = data; - int i; + unsigned int i; unsigned int n; const char *name;