Fix error -Werror=sign-compare 43/310443/2 accepted/tizen/unified/20240502.044634 accepted/tizen/unified/toolchain/20240507.011902 accepted/tizen/unified/x/20240503.091141 accepted/tizen/unified/x/20240508.055413
authorYoungjae Cho <y0.cho@samsung.com>
Mon, 29 Apr 2024 06:32:34 +0000 (15:32 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 29 Apr 2024 08:39:23 +0000 (08:39 +0000)
Change-Id: Iba8b94f3eaa7cbc9fa8357cb540001e4669fbad3
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/upgrade-apply/main.c
src/upgrade-apply/patch/patch.c

index 41620fb733826eeb5cdffdd702d46853d9f35ea1..a74dec2d94731d264f8110b5ca1322815bfee723 100644 (file)
@@ -148,7 +148,7 @@ struct parse_result parse_args(int argc, char **argv)
                        if (dest_size != 0)
                                return (struct parse_result) { .result = PARSE_REPEATED_ARGUMENT };
                        dest_size = atoi(optarg);
-                       if (dest_size <= 0 || dest_size > SIZE_MAX)
+                       if (dest_size <= 0 || (size_t)dest_size > SIZE_MAX)
                                return (struct parse_result) { .result = PARSE_BAD_SIZE };
                        break;
 
index 927ee39f732d3d608557dd59979792207157cdb3..909007cd84a3a3528b53fd3f62f372e803667fb8 100644 (file)
@@ -118,7 +118,7 @@ static int set_new_pos(off_t new_pos, struct file_info *finfo)
 {
     int res = PF_OK;
     off_t local_pos = new_pos - finfo->offset;
-    if (local_pos < 0 || local_pos > finfo->mmapped_len) {
+    if (local_pos < 0 || (size_t)local_pos > finfo->mmapped_len) {
         res = remmap(finfo, new_pos);
     }
     if (res == PF_OK) {